virtio-bindings-0.2.6/.cargo_vcs_info.json0000644000000001550000000000100141510ustar { "git": { "sha1": "723163160efa0a0c605bbed6c6fd4c664f98ee44" }, "path_in_vcs": "virtio-bindings" }virtio-bindings-0.2.6/CHANGELOG.md000064400000000000000000000036511046102023000145560ustar 00000000000000# Upcoming Release # v0.2.6 ## Changed - Bindings are now once again distributed with the crate, rather than generated at build time. - Regenerate bindings with Linux 6.15. - Remove unused feature flags and build dependencies. # v0.2.5 ## Changed - Regenerate bindings with Linux 6.12. - Introduced bindgen build dependency and its clang development package dependency. See bindgen fix below for why this was necessary. ## Fixed - Add license files. - Use bindgen library from build.rs to fix i686 builds due to x86_64-specific alignment checks. # v0.2.4 ## Changed - Regenerate bindings with bindgen 0.70.1. # v0.2.3 ## Added - Exposed virtio_ids.h bindings as a public module. - Regenerate bindings with Linux 6.10. - Added virtio_input.h bindings. # v0.2.2 ## Added - Added bindings for virtio_ids.h - Regenerate bindings with Linux 6.4. # v0.2.1 - Regenerate bindings with Linux 6.3. - Added bindings for virtio_scsi.h - Updated vm-memory from 0.10.0 to 0.12.0. # v0.2.0 ## Added - Add bindings for virtio_config.h, virtio_gpu.h, and virtio_mmio.h ## Changed - Regenerate bindings with Glibc 2.36, Linux 6.1, and bindgen 0.63.0 - The `virtio-v4_14_0` and `virtio-v5_0_0` crate features are now no-ops — the latest version of the bindings is now always used. - The bindings modules no longer accidentally re-export constants from Glibc or other kernel headers. As a result of this, it is no longer possible to reference constants from virtio_config.h through e.g. the `virtio_net` module, only through the `virtio_config` module. # v0.1.0 This is the first `virtio-bindings` crate release. This crate provides Rust FFI bindings to the [Virtual I/O Device (VIRTIO)](https://docs.oasis-open.org/virtio/virtio/v1.1/virtio-v1.1.html) Linux kernel API. With this first release, the bindings are for the Linux kernel versions 4.14 and 5.0. The bindings are generated using [bindgen](https://crates.io/crates/bindgen). virtio-bindings-0.2.6/CONTRIBUTING.md000064400000000000000000000012101046102023000151630ustar 00000000000000# Contributing to virtio-bindings ## Dependencies ### Bindgen The bindings are currently generated using [bindgen](https://rust-lang.github.io/rust-bindgen/) version 0.71.1: ```bash cargo install bindgen-cli --vers 0.71.1 ``` ### Linux Kernel Generating bindings depends on the Linux kernel, so you need to have the repository on your machine: ```bash git clone https://github.com/torvalds/linux.git ``` ## Example for updating to a new kernel version For this example we assume that you have both linux and virtio-bindings repositories in your home directory. ```bash cd ~/vm-virtio/virtio-bindings scripts/generate-bindings.sh ~/linux ``` virtio-bindings-0.2.6/Cargo.lock0000644000000002370000000000100121250ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "virtio-bindings" version = "0.2.6" virtio-bindings-0.2.6/Cargo.toml0000644000000017130000000000100121500ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" name = "virtio-bindings" version = "0.2.6" authors = ["Sergio Lopez "] build = false autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "Rust FFI bindings to virtio generated using bindgen." readme = "README.md" keywords = ["virtio"] license = "BSD-3-Clause OR Apache-2.0" repository = "https://github.com/rust-vmm/vm-virtio" [features] [lib] name = "virtio_bindings" path = "src/lib.rs" [dependencies] virtio-bindings-0.2.6/Cargo.toml.orig000064400000000000000000000005321046102023000156270ustar 00000000000000[package] name = "virtio-bindings" version = "0.2.6" authors = ["Sergio Lopez "] description = "Rust FFI bindings to virtio generated using bindgen." repository = "https://github.com/rust-vmm/vm-virtio" readme = "README.md" edition = "2021" keywords = ["virtio"] license = "BSD-3-Clause OR Apache-2.0" [features] [dependencies] virtio-bindings-0.2.6/LICENSE-APACHE000064400000000000000000000261361046102023000146740ustar 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. virtio-bindings-0.2.6/LICENSE-BSD-3-Clause000064400000000000000000000030321046102023000157230ustar 00000000000000// Copyright 2017 The Chromium OS Authors. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. virtio-bindings-0.2.6/README.md000064400000000000000000000007231046102023000142210ustar 00000000000000# virtio-bindings Rust FFI bindings to virtio generated using [bindgen](https://crates.io/crates/bindgen). ## Usage Add this to your `Cargo.toml`: ```toml virtio-bindings = "0.2" ``` You can then import the bindings where you need them. As an example, to grab the bindings for virtio-blk, you can do: ```rust use virtio_bindings::bindings::virtio_blk::*; ``` ## Development To update the bindings, follow the steps in the [Contributing Document](CONTRIBUTING.md). virtio-bindings-0.2.6/import-linux-headers.sh000075500000000000000000000014101046102023000173530ustar 00000000000000#!/bin/bash # SPDX-License-Identifier: (BSD-3-Clause OR Apache-2.0) # Copyright Red Hat, Inc. # # ./import-linux-headers.sh path/to/kernel/headers # # Import header files from a Linux kernel header tree. Be sure to run `cargo # build` to test that bindgen succeeds before committing the updated headers. src=$1 dst=include/linux import_header() { # Use our local header files rather than system headers sed -e 's%#include <\([^>]*\)>%#include "\1"%' "$1" >"$2" } mkdir -p "$dst" # If you change this list, remember to update build.rs for header in \ virtio_blk \ virtio_config \ virtio_gpu \ virtio_ids \ virtio_input \ virtio_mmio \ virtio_net \ virtio_ring \ virtio_scsi \ virtio_types; do import_header "$src/include/linux/$header.h" "$dst/$header.h" done virtio-bindings-0.2.6/scripts/generate-bindings.sh000075500000000000000000000025151046102023000203560ustar 00000000000000# Copyright 2025 Alyssa Ross # SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0 headers="$(mktemp -d --suffix .generate-bindings)" trap 'rm -rf -- "$headers"' EXIT make -C "$1" INSTALL_HDR_PATH="$headers" headers_install while read -r rust_arch clang_target; do mkdir -p "src/bindings/$rust_arch" for header in \ virtio_blk \ virtio_config \ virtio_gpu \ virtio_ids \ virtio_input \ virtio_mmio \ virtio_net \ virtio_ring \ virtio_scsi \ ; do \ bindgen "$headers/include/linux/$header.h" \ -o "src/bindings/$rust_arch/$header.rs" \ --allowlist-file "$headers/include/linux/$header.h" \ --with-derive-default \ --with-derive-partialeq \ -- \ --target="$clang_target" \ -I"$headers/include" done done <(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/aarch64/virtio_config.rs000064400000000000000000000017241046102023000217670ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/aarch64/virtio_gpu.rs000064400000000000000000001331711046102023000213170ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/aarch64/virtio_ids.rs000064400000000000000000000035111046102023000212750ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/aarch64/virtio_input.rs000064400000000000000000000147261046102023000216670ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/aarch64/virtio_mmio.rs000064400000000000000000000031421046102023000214570ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/aarch64/virtio_net.rs000064400000000000000000001227671046102023000213230ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/aarch64/virtio_ring.rs000064400000000000000000000201301046102023000214510ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 32usize]; ["Alignment of vring"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 8usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 16usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 24usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/aarch64/virtio_scsi.rs000064400000000000000000000312641046102023000214650ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/arm/virtio_blk.rs000064400000000000000000000411001046102023000206110ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/arm/virtio_config.rs000064400000000000000000000017241046102023000213160ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/arm/virtio_gpu.rs000064400000000000000000001331711046102023000206460ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/arm/virtio_ids.rs000064400000000000000000000035111046102023000206240ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/arm/virtio_input.rs000064400000000000000000000147261046102023000212160ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/arm/virtio_mmio.rs000064400000000000000000000031421046102023000210060ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/arm/virtio_net.rs000064400000000000000000001227671046102023000206520ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/arm/virtio_ring.rs000064400000000000000000000201271046102023000210060ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 16usize]; ["Alignment of vring"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 4usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 8usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 12usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/arm/virtio_scsi.rs000064400000000000000000000312641046102023000210140ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/hexagon/virtio_blk.rs000064400000000000000000000411001046102023000214630ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/hexagon/virtio_config.rs000064400000000000000000000017241046102023000221700ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/hexagon/virtio_gpu.rs000064400000000000000000001331751046102023000215240ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_ushort; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uchar; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uchar; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/hexagon/virtio_ids.rs000064400000000000000000000035111046102023000214760ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/hexagon/virtio_input.rs000064400000000000000000000147271046102023000220710ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uchar; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/hexagon/virtio_mmio.rs000064400000000000000000000031421046102023000216600ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/hexagon/virtio_net.rs000064400000000000000000001227671046102023000215240ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/hexagon/virtio_ring.rs000064400000000000000000000201271046102023000216600ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 16usize]; ["Alignment of vring"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 4usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 8usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 12usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/hexagon/virtio_scsi.rs000064400000000000000000000312641046102023000216660ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/loongarch64/virtio_blk.rs000064400000000000000000000411001046102023000221600ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/loongarch64/virtio_config.rs000064400000000000000000000017241046102023000226650ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/loongarch64/virtio_gpu.rs000064400000000000000000001331711046102023000222150ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/loongarch64/virtio_ids.rs000064400000000000000000000035111046102023000221730ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/loongarch64/virtio_input.rs000064400000000000000000000147261046102023000225650ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/loongarch64/virtio_mmio.rs000064400000000000000000000031421046102023000223550ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/loongarch64/virtio_net.rs000064400000000000000000001227671046102023000222210ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/loongarch64/virtio_ring.rs000064400000000000000000000201301046102023000223470ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 32usize]; ["Alignment of vring"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 8usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 16usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 24usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/loongarch64/virtio_scsi.rs000064400000000000000000000312641046102023000223630ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/m68k/virtio_blk.rs000064400000000000000000000411001046102023000206170ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/m68k/virtio_config.rs000064400000000000000000000017241046102023000213240ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/m68k/virtio_gpu.rs000064400000000000000000001331711046102023000206540ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/m68k/virtio_ids.rs000064400000000000000000000035111046102023000206320ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/m68k/virtio_input.rs000064400000000000000000000147261046102023000212240ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/m68k/virtio_mmio.rs000064400000000000000000000031421046102023000210140ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/m68k/virtio_net.rs000064400000000000000000001227671046102023000206600ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/m68k/virtio_ring.rs000064400000000000000000000201271046102023000210140ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 16usize]; ["Alignment of vring"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 4usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 8usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 12usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/m68k/virtio_scsi.rs000064400000000000000000000312641046102023000210220ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/mips/virtio_blk.rs000064400000000000000000000411001046102023000210020ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/mips/virtio_config.rs000064400000000000000000000017241046102023000215070ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/mips/virtio_gpu.rs000064400000000000000000001331711046102023000210370ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/mips/virtio_ids.rs000064400000000000000000000035111046102023000210150ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/mips/virtio_input.rs000064400000000000000000000147261046102023000214070ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/mips/virtio_mmio.rs000064400000000000000000000031421046102023000211770ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/mips/virtio_net.rs000064400000000000000000001227671046102023000210430ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/mips/virtio_ring.rs000064400000000000000000000201271046102023000211770ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 16usize]; ["Alignment of vring"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 4usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 8usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 12usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/mips/virtio_scsi.rs000064400000000000000000000312641046102023000212050ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/mips32r6/virtio_blk.rs000064400000000000000000000411001046102023000214170ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/mips32r6/virtio_config.rs000064400000000000000000000017241046102023000221240ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/mips32r6/virtio_gpu.rs000064400000000000000000001331711046102023000214540ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/mips32r6/virtio_ids.rs000064400000000000000000000035111046102023000214320ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/mips32r6/virtio_input.rs000064400000000000000000000147261046102023000220240ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/mips32r6/virtio_mmio.rs000064400000000000000000000031421046102023000216140ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/mips32r6/virtio_net.rs000064400000000000000000001227671046102023000214600ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/mips32r6/virtio_ring.rs000064400000000000000000000201271046102023000216140ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 16usize]; ["Alignment of vring"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 4usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 8usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 12usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/mips32r6/virtio_scsi.rs000064400000000000000000000312641046102023000216220ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/mips64/virtio_blk.rs000064400000000000000000000411001046102023000211540ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/mips64/virtio_config.rs000064400000000000000000000017241046102023000216610ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/mips64/virtio_gpu.rs000064400000000000000000001331711046102023000212110ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/mips64/virtio_ids.rs000064400000000000000000000035111046102023000211670ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/mips64/virtio_input.rs000064400000000000000000000147261046102023000215610ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/mips64/virtio_mmio.rs000064400000000000000000000031421046102023000213510ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/mips64/virtio_net.rs000064400000000000000000001227671046102023000212150ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/mips64/virtio_ring.rs000064400000000000000000000201301046102023000213430ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 32usize]; ["Alignment of vring"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 8usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 16usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 24usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/mips64/virtio_scsi.rs000064400000000000000000000312641046102023000213570ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/mips64r6/virtio_blk.rs000064400000000000000000000411001046102023000214240ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/mips64r6/virtio_config.rs000064400000000000000000000017241046102023000221310ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/mips64r6/virtio_gpu.rs000064400000000000000000001331711046102023000214610ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/mips64r6/virtio_ids.rs000064400000000000000000000035111046102023000214370ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/mips64r6/virtio_input.rs000064400000000000000000000147261046102023000220310ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/mips64r6/virtio_mmio.rs000064400000000000000000000031421046102023000216210ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/mips64r6/virtio_net.rs000064400000000000000000001227671046102023000214650ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/mips64r6/virtio_ring.rs000064400000000000000000000201301046102023000216130ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 32usize]; ["Alignment of vring"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 8usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 16usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 24usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/mips64r6/virtio_scsi.rs000064400000000000000000000312641046102023000216270ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc/virtio_blk.rs000064400000000000000000000411001046102023000215110ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc/virtio_config.rs000064400000000000000000000017241046102023000222160ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/powerpc/virtio_gpu.rs000064400000000000000000001331711046102023000215460ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc/virtio_ids.rs000064400000000000000000000035111046102023000215240ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/powerpc/virtio_input.rs000064400000000000000000000147261046102023000221160ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc/virtio_mmio.rs000064400000000000000000000031421046102023000217060ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/powerpc/virtio_net.rs000064400000000000000000001227671046102023000215520ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc/virtio_ring.rs000064400000000000000000000201271046102023000217060ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 16usize]; ["Alignment of vring"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 4usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 8usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 12usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc/virtio_scsi.rs000064400000000000000000000312641046102023000217140ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc64/virtio_blk.rs000064400000000000000000000411001046102023000216630ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc64/virtio_config.rs000064400000000000000000000017241046102023000223700ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/powerpc64/virtio_gpu.rs000064400000000000000000001331711046102023000217200ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc64/virtio_ids.rs000064400000000000000000000035111046102023000216760ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/powerpc64/virtio_input.rs000064400000000000000000000147261046102023000222700ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc64/virtio_mmio.rs000064400000000000000000000031421046102023000220600ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/powerpc64/virtio_net.rs000064400000000000000000001227671046102023000217240ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc64/virtio_ring.rs000064400000000000000000000201301046102023000220520ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 32usize]; ["Alignment of vring"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 8usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 16usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 24usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/powerpc64/virtio_scsi.rs000064400000000000000000000312641046102023000220660ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/riscv32/virtio_blk.rs000064400000000000000000000411001046102023000213250ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/riscv32/virtio_config.rs000064400000000000000000000017241046102023000220320ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/riscv32/virtio_gpu.rs000064400000000000000000001331711046102023000213620ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/riscv32/virtio_ids.rs000064400000000000000000000035111046102023000213400ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/riscv32/virtio_input.rs000064400000000000000000000147261046102023000217320ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/riscv32/virtio_mmio.rs000064400000000000000000000031421046102023000215220ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/riscv32/virtio_net.rs000064400000000000000000001227671046102023000213660ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/riscv32/virtio_ring.rs000064400000000000000000000201271046102023000215220ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 16usize]; ["Alignment of vring"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 4usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 8usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 12usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/riscv32/virtio_scsi.rs000064400000000000000000000312641046102023000215300ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/riscv64/virtio_blk.rs000064400000000000000000000411001046102023000213320ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/riscv64/virtio_config.rs000064400000000000000000000017241046102023000220370ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/riscv64/virtio_gpu.rs000064400000000000000000001331711046102023000213670ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/riscv64/virtio_ids.rs000064400000000000000000000035111046102023000213450ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/riscv64/virtio_input.rs000064400000000000000000000147261046102023000217370ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/riscv64/virtio_mmio.rs000064400000000000000000000031421046102023000215270ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/riscv64/virtio_net.rs000064400000000000000000001227671046102023000213730ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/riscv64/virtio_ring.rs000064400000000000000000000201301046102023000215210ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 32usize]; ["Alignment of vring"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 8usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 16usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 24usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/riscv64/virtio_scsi.rs000064400000000000000000000312641046102023000215350ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/s390x/virtio_blk.rs000064400000000000000000000411001046102023000207200ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/s390x/virtio_config.rs000064400000000000000000000017241046102023000214250ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/s390x/virtio_gpu.rs000064400000000000000000001331711046102023000207550ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/s390x/virtio_ids.rs000064400000000000000000000035111046102023000207330ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/s390x/virtio_input.rs000064400000000000000000000147261046102023000213250ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/s390x/virtio_mmio.rs000064400000000000000000000031421046102023000211150ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/s390x/virtio_net.rs000064400000000000000000001227671046102023000207610ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/s390x/virtio_ring.rs000064400000000000000000000201301046102023000211070ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 32usize]; ["Alignment of vring"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 8usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 16usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 24usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/s390x/virtio_scsi.rs000064400000000000000000000312641046102023000211230ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/sparc/virtio_blk.rs000064400000000000000000000411001046102023000211420ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/sparc/virtio_config.rs000064400000000000000000000017241046102023000216470ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/sparc/virtio_gpu.rs000064400000000000000000001331711046102023000211770ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/sparc/virtio_ids.rs000064400000000000000000000035111046102023000211550ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/sparc/virtio_input.rs000064400000000000000000000147261046102023000215470ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/sparc/virtio_mmio.rs000064400000000000000000000031421046102023000213370ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/sparc/virtio_net.rs000064400000000000000000001227671046102023000212030ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/sparc/virtio_ring.rs000064400000000000000000000201271046102023000213370ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 16usize]; ["Alignment of vring"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 4usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 8usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 12usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/sparc/virtio_scsi.rs000064400000000000000000000312641046102023000213450ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/sparc64/virtio_blk.rs000064400000000000000000000411001046102023000213140ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/sparc64/virtio_config.rs000064400000000000000000000017241046102023000220210ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/sparc64/virtio_gpu.rs000064400000000000000000001331711046102023000213510ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/sparc64/virtio_ids.rs000064400000000000000000000035111046102023000213270ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/sparc64/virtio_input.rs000064400000000000000000000147261046102023000217210ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/sparc64/virtio_mmio.rs000064400000000000000000000031421046102023000215110ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/sparc64/virtio_net.rs000064400000000000000000001227671046102023000213550ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/sparc64/virtio_ring.rs000064400000000000000000000201301046102023000215030ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 32usize]; ["Alignment of vring"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 8usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 16usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 24usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/sparc64/virtio_scsi.rs000064400000000000000000000312641046102023000215170ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/x86/virtio_blk.rs000064400000000000000000000411001046102023000204570ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/x86/virtio_config.rs000064400000000000000000000017241046102023000211640ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/x86/virtio_gpu.rs000064400000000000000000001331711046102023000205140ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/x86/virtio_ids.rs000064400000000000000000000035111046102023000204720ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/x86/virtio_input.rs000064400000000000000000000147261046102023000210640ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/x86/virtio_mmio.rs000064400000000000000000000031421046102023000206540ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/x86/virtio_net.rs000064400000000000000000001227671046102023000205200ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/x86/virtio_ring.rs000064400000000000000000000201271046102023000206540ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 16usize]; ["Alignment of vring"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 4usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 8usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 12usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/x86/virtio_scsi.rs000064400000000000000000000312641046102023000206620ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/bindings/x86_64/virtio_blk.rs000064400000000000000000000411001046102023000207700ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_BLK_F_SIZE_MAX: u32 = 1; pub const VIRTIO_BLK_F_SEG_MAX: u32 = 2; pub const VIRTIO_BLK_F_GEOMETRY: u32 = 4; pub const VIRTIO_BLK_F_RO: u32 = 5; pub const VIRTIO_BLK_F_BLK_SIZE: u32 = 6; pub const VIRTIO_BLK_F_TOPOLOGY: u32 = 10; pub const VIRTIO_BLK_F_MQ: u32 = 12; pub const VIRTIO_BLK_F_DISCARD: u32 = 13; pub const VIRTIO_BLK_F_WRITE_ZEROES: u32 = 14; pub const VIRTIO_BLK_F_SECURE_ERASE: u32 = 16; pub const VIRTIO_BLK_F_ZONED: u32 = 17; pub const VIRTIO_BLK_F_BARRIER: u32 = 0; pub const VIRTIO_BLK_F_SCSI: u32 = 7; pub const VIRTIO_BLK_F_FLUSH: u32 = 9; pub const VIRTIO_BLK_F_CONFIG_WCE: u32 = 11; pub const VIRTIO_BLK_F_WCE: u32 = 9; pub const VIRTIO_BLK_ID_BYTES: u32 = 20; pub const VIRTIO_BLK_T_IN: u32 = 0; pub const VIRTIO_BLK_T_OUT: u32 = 1; pub const VIRTIO_BLK_T_SCSI_CMD: u32 = 2; pub const VIRTIO_BLK_T_FLUSH: u32 = 4; pub const VIRTIO_BLK_T_GET_ID: u32 = 8; pub const VIRTIO_BLK_T_DISCARD: u32 = 11; pub const VIRTIO_BLK_T_WRITE_ZEROES: u32 = 13; pub const VIRTIO_BLK_T_SECURE_ERASE: u32 = 14; pub const VIRTIO_BLK_T_ZONE_APPEND: u32 = 15; pub const VIRTIO_BLK_T_ZONE_REPORT: u32 = 16; pub const VIRTIO_BLK_T_ZONE_OPEN: u32 = 18; pub const VIRTIO_BLK_T_ZONE_CLOSE: u32 = 20; pub const VIRTIO_BLK_T_ZONE_FINISH: u32 = 22; pub const VIRTIO_BLK_T_ZONE_RESET: u32 = 24; pub const VIRTIO_BLK_T_ZONE_RESET_ALL: u32 = 26; pub const VIRTIO_BLK_T_BARRIER: u32 = 2147483648; pub const VIRTIO_BLK_Z_NONE: u32 = 0; pub const VIRTIO_BLK_Z_HM: u32 = 1; pub const VIRTIO_BLK_Z_HA: u32 = 2; pub const VIRTIO_BLK_ZT_CONV: u32 = 1; pub const VIRTIO_BLK_ZT_SWR: u32 = 2; pub const VIRTIO_BLK_ZT_SWP: u32 = 3; pub const VIRTIO_BLK_ZS_NOT_WP: u32 = 0; pub const VIRTIO_BLK_ZS_EMPTY: u32 = 1; pub const VIRTIO_BLK_ZS_IOPEN: u32 = 2; pub const VIRTIO_BLK_ZS_EOPEN: u32 = 3; pub const VIRTIO_BLK_ZS_CLOSED: u32 = 4; pub const VIRTIO_BLK_ZS_RDONLY: u32 = 13; pub const VIRTIO_BLK_ZS_FULL: u32 = 14; pub const VIRTIO_BLK_ZS_OFFLINE: u32 = 15; pub const VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP: u32 = 1; pub const VIRTIO_BLK_S_OK: u32 = 0; pub const VIRTIO_BLK_S_IOERR: u32 = 1; pub const VIRTIO_BLK_S_UNSUPP: u32 = 2; pub const VIRTIO_BLK_S_ZONE_INVALID_CMD: u32 = 3; pub const VIRTIO_BLK_S_ZONE_UNALIGNED_WP: u32 = 4; pub const VIRTIO_BLK_S_ZONE_OPEN_RESOURCE: u32 = 5; pub const VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE: u32 = 6; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config { pub capacity: __virtio64, pub size_max: __virtio32, pub seg_max: __virtio32, pub geometry: virtio_blk_config_virtio_blk_geometry, pub blk_size: __virtio32, pub physical_block_exp: __u8, pub alignment_offset: __u8, pub min_io_size: __virtio16, pub opt_io_size: __virtio32, pub wce: __u8, pub unused: __u8, pub num_queues: __virtio16, pub max_discard_sectors: __virtio32, pub max_discard_seg: __virtio32, pub discard_sector_alignment: __virtio32, pub max_write_zeroes_sectors: __virtio32, pub max_write_zeroes_seg: __virtio32, pub write_zeroes_may_unmap: __u8, pub unused1: [__u8; 3usize], pub max_secure_erase_sectors: __virtio32, pub max_secure_erase_seg: __virtio32, pub secure_erase_sector_alignment: __virtio32, pub zoned: virtio_blk_config_virtio_blk_zoned_characteristics, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_geometry { pub cylinders: __virtio16, pub heads: __u8, pub sectors: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_geometry"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_blk_config_virtio_blk_geometry"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::cylinders"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, cylinders) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::heads"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, heads) - 2usize]; ["Offset of field: virtio_blk_config_virtio_blk_geometry::sectors"] [::std::mem::offset_of!(virtio_blk_config_virtio_blk_geometry, sectors) - 3usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_config_virtio_blk_zoned_characteristics { pub zone_sectors: __virtio32, pub max_open_zones: __virtio32, pub max_active_zones: __virtio32, pub max_append_sectors: __virtio32, pub write_granularity: __virtio32, pub model: __u8, pub unused2: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_blk_config_virtio_blk_zoned_characteristics"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::zone_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, zone_sectors ) - 0usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_open_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_open_zones ) - 4usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_active_zones"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_active_zones ) - 8usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::max_append_sectors"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, max_append_sectors ) - 12usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::write_granularity"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, write_granularity ) - 16usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::model"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, model ) - 20usize]; ["Offset of field: virtio_blk_config_virtio_blk_zoned_characteristics::unused2"][::std::mem::offset_of!( virtio_blk_config_virtio_blk_zoned_characteristics, unused2 ) - 21usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_config"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_blk_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_blk_config::capacity"] [::std::mem::offset_of!(virtio_blk_config, capacity) - 0usize]; ["Offset of field: virtio_blk_config::size_max"] [::std::mem::offset_of!(virtio_blk_config, size_max) - 8usize]; ["Offset of field: virtio_blk_config::seg_max"] [::std::mem::offset_of!(virtio_blk_config, seg_max) - 12usize]; ["Offset of field: virtio_blk_config::geometry"] [::std::mem::offset_of!(virtio_blk_config, geometry) - 16usize]; ["Offset of field: virtio_blk_config::blk_size"] [::std::mem::offset_of!(virtio_blk_config, blk_size) - 20usize]; ["Offset of field: virtio_blk_config::physical_block_exp"] [::std::mem::offset_of!(virtio_blk_config, physical_block_exp) - 24usize]; ["Offset of field: virtio_blk_config::alignment_offset"] [::std::mem::offset_of!(virtio_blk_config, alignment_offset) - 25usize]; ["Offset of field: virtio_blk_config::min_io_size"] [::std::mem::offset_of!(virtio_blk_config, min_io_size) - 26usize]; ["Offset of field: virtio_blk_config::opt_io_size"] [::std::mem::offset_of!(virtio_blk_config, opt_io_size) - 28usize]; ["Offset of field: virtio_blk_config::wce"] [::std::mem::offset_of!(virtio_blk_config, wce) - 32usize]; ["Offset of field: virtio_blk_config::unused"] [::std::mem::offset_of!(virtio_blk_config, unused) - 33usize]; ["Offset of field: virtio_blk_config::num_queues"] [::std::mem::offset_of!(virtio_blk_config, num_queues) - 34usize]; ["Offset of field: virtio_blk_config::max_discard_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_discard_sectors) - 36usize]; ["Offset of field: virtio_blk_config::max_discard_seg"] [::std::mem::offset_of!(virtio_blk_config, max_discard_seg) - 40usize]; ["Offset of field: virtio_blk_config::discard_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, discard_sector_alignment) - 44usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_sectors) - 48usize]; ["Offset of field: virtio_blk_config::max_write_zeroes_seg"] [::std::mem::offset_of!(virtio_blk_config, max_write_zeroes_seg) - 52usize]; ["Offset of field: virtio_blk_config::write_zeroes_may_unmap"] [::std::mem::offset_of!(virtio_blk_config, write_zeroes_may_unmap) - 56usize]; ["Offset of field: virtio_blk_config::unused1"] [::std::mem::offset_of!(virtio_blk_config, unused1) - 57usize]; ["Offset of field: virtio_blk_config::max_secure_erase_sectors"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_sectors) - 60usize]; ["Offset of field: virtio_blk_config::max_secure_erase_seg"] [::std::mem::offset_of!(virtio_blk_config, max_secure_erase_seg) - 64usize]; ["Offset of field: virtio_blk_config::secure_erase_sector_alignment"] [::std::mem::offset_of!(virtio_blk_config, secure_erase_sector_alignment) - 68usize]; ["Offset of field: virtio_blk_config::zoned"] [::std::mem::offset_of!(virtio_blk_config, zoned) - 72usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_outhdr { pub type_: __virtio32, pub ioprio: __virtio32, pub sector: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_outhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_outhdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_outhdr::type_"] [::std::mem::offset_of!(virtio_blk_outhdr, type_) - 0usize]; ["Offset of field: virtio_blk_outhdr::ioprio"] [::std::mem::offset_of!(virtio_blk_outhdr, ioprio) - 4usize]; ["Offset of field: virtio_blk_outhdr::sector"] [::std::mem::offset_of!(virtio_blk_outhdr, sector) - 8usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_blk_zone_descriptor { pub z_cap: __virtio64, pub z_start: __virtio64, pub z_wp: __virtio64, pub z_type: __u8, pub z_state: __u8, pub reserved: [__u8; 38usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_descriptor"] [::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_descriptor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_cap"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_cap) - 0usize]; ["Offset of field: virtio_blk_zone_descriptor::z_start"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_start) - 8usize]; ["Offset of field: virtio_blk_zone_descriptor::z_wp"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_wp) - 16usize]; ["Offset of field: virtio_blk_zone_descriptor::z_type"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_type) - 24usize]; ["Offset of field: virtio_blk_zone_descriptor::z_state"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, z_state) - 25usize]; ["Offset of field: virtio_blk_zone_descriptor::reserved"] [::std::mem::offset_of!(virtio_blk_zone_descriptor, reserved) - 26usize]; }; impl Default for virtio_blk_zone_descriptor { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug)] pub struct virtio_blk_zone_report { pub nr_zones: __virtio64, pub reserved: [__u8; 56usize], pub zones: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_zone_report"][::std::mem::size_of::() - 64usize]; ["Alignment of virtio_blk_zone_report"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_zone_report::nr_zones"] [::std::mem::offset_of!(virtio_blk_zone_report, nr_zones) - 0usize]; ["Offset of field: virtio_blk_zone_report::reserved"] [::std::mem::offset_of!(virtio_blk_zone_report, reserved) - 8usize]; ["Offset of field: virtio_blk_zone_report::zones"] [::std::mem::offset_of!(virtio_blk_zone_report, zones) - 64usize]; }; impl Default for virtio_blk_zone_report { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_blk_discard_write_zeroes { pub sector: __le64, pub num_sectors: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_blk_discard_write_zeroes"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_blk_discard_write_zeroes"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::sector"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, sector) - 0usize]; ["Offset of field: virtio_blk_discard_write_zeroes::num_sectors"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, num_sectors) - 8usize]; ["Offset of field: virtio_blk_discard_write_zeroes::flags"] [::std::mem::offset_of!(virtio_blk_discard_write_zeroes, flags) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_inhdr { pub errors: __virtio32, pub data_len: __virtio32, pub sense_len: __virtio32, pub residual: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_inhdr"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_inhdr"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_scsi_inhdr::errors"] [::std::mem::offset_of!(virtio_scsi_inhdr, errors) - 0usize]; ["Offset of field: virtio_scsi_inhdr::data_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, data_len) - 4usize]; ["Offset of field: virtio_scsi_inhdr::sense_len"] [::std::mem::offset_of!(virtio_scsi_inhdr, sense_len) - 8usize]; ["Offset of field: virtio_scsi_inhdr::residual"] [::std::mem::offset_of!(virtio_scsi_inhdr, residual) - 12usize]; }; virtio-bindings-0.2.6/src/bindings/x86_64/virtio_config.rs000064400000000000000000000017241046102023000214750ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_CONFIG_S_ACKNOWLEDGE: u32 = 1; pub const VIRTIO_CONFIG_S_DRIVER: u32 = 2; pub const VIRTIO_CONFIG_S_DRIVER_OK: u32 = 4; pub const VIRTIO_CONFIG_S_FEATURES_OK: u32 = 8; pub const VIRTIO_CONFIG_S_NEEDS_RESET: u32 = 64; pub const VIRTIO_CONFIG_S_FAILED: u32 = 128; pub const VIRTIO_TRANSPORT_F_START: u32 = 28; pub const VIRTIO_TRANSPORT_F_END: u32 = 42; pub const VIRTIO_F_NOTIFY_ON_EMPTY: u32 = 24; pub const VIRTIO_F_ANY_LAYOUT: u32 = 27; pub const VIRTIO_F_VERSION_1: u32 = 32; pub const VIRTIO_F_ACCESS_PLATFORM: u32 = 33; pub const VIRTIO_F_IOMMU_PLATFORM: u32 = 33; pub const VIRTIO_F_RING_PACKED: u32 = 34; pub const VIRTIO_F_IN_ORDER: u32 = 35; pub const VIRTIO_F_ORDER_PLATFORM: u32 = 36; pub const VIRTIO_F_SR_IOV: u32 = 37; pub const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub const VIRTIO_F_NOTIF_CONFIG_DATA: u32 = 39; pub const VIRTIO_F_RING_RESET: u32 = 40; pub const VIRTIO_F_ADMIN_VQ: u32 = 41; virtio-bindings-0.2.6/src/bindings/x86_64/virtio_gpu.rs000064400000000000000000001331711046102023000210250ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_GPU_F_VIRGL: u32 = 0; pub const VIRTIO_GPU_F_EDID: u32 = 1; pub const VIRTIO_GPU_F_RESOURCE_UUID: u32 = 2; pub const VIRTIO_GPU_F_RESOURCE_BLOB: u32 = 3; pub const VIRTIO_GPU_F_CONTEXT_INIT: u32 = 4; pub const VIRTIO_GPU_FLAG_FENCE: u32 = 1; pub const VIRTIO_GPU_FLAG_INFO_RING_IDX: u32 = 2; pub const VIRTIO_GPU_MAX_SCANOUTS: u32 = 16; pub const VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP: u32 = 1; pub const VIRTIO_GPU_CONTEXT_INIT_CAPSET_ID_MASK: u32 = 255; pub const VIRTIO_GPU_CAPSET_VIRGL: u32 = 1; pub const VIRTIO_GPU_CAPSET_VIRGL2: u32 = 2; pub const VIRTIO_GPU_CAPSET_VENUS: u32 = 4; pub const VIRTIO_GPU_CAPSET_DRM: u32 = 6; pub const VIRTIO_GPU_EVENT_DISPLAY: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_GUEST: u32 = 1; pub const VIRTIO_GPU_BLOB_MEM_HOST3D: u32 = 2; pub const VIRTIO_GPU_BLOB_MEM_HOST3D_GUEST: u32 = 3; pub const VIRTIO_GPU_BLOB_FLAG_USE_MAPPABLE: u32 = 1; pub const VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE: u32 = 2; pub const VIRTIO_GPU_BLOB_FLAG_USE_CROSS_DEVICE: u32 = 4; pub const VIRTIO_GPU_MAP_CACHE_MASK: u32 = 15; pub const VIRTIO_GPU_MAP_CACHE_NONE: u32 = 0; pub const VIRTIO_GPU_MAP_CACHE_CACHED: u32 = 1; pub const VIRTIO_GPU_MAP_CACHE_UNCACHED: u32 = 2; pub const VIRTIO_GPU_MAP_CACHE_WC: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le32 = __u32; pub type __le64 = __u64; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_UNDEFINED: virtio_gpu_ctrl_type = 0; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_DISPLAY_INFO: virtio_gpu_ctrl_type = 256; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_2D: virtio_gpu_ctrl_type = 257; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNREF: virtio_gpu_ctrl_type = 258; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT: virtio_gpu_ctrl_type = 259; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_FLUSH: virtio_gpu_ctrl_type = 260; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D: virtio_gpu_ctrl_type = 261; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING: virtio_gpu_ctrl_type = 262; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: virtio_gpu_ctrl_type = 263; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET_INFO: virtio_gpu_ctrl_type = 264; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_CAPSET: virtio_gpu_ctrl_type = 265; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_GET_EDID: virtio_gpu_ctrl_type = 266; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID: virtio_gpu_ctrl_type = 267; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOB: virtio_gpu_ctrl_type = 268; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SET_SCANOUT_BLOB: virtio_gpu_ctrl_type = 269; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_CREATE: virtio_gpu_ctrl_type = 512; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DESTROY: virtio_gpu_ctrl_type = 513; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_ATTACH_RESOURCE: virtio_gpu_ctrl_type = 514; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_CTX_DETACH_RESOURCE: virtio_gpu_ctrl_type = 515; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_CREATE_3D: virtio_gpu_ctrl_type = 516; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D: virtio_gpu_ctrl_type = 517; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D: virtio_gpu_ctrl_type = 518; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_SUBMIT_3D: virtio_gpu_ctrl_type = 519; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB: virtio_gpu_ctrl_type = 520; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB: virtio_gpu_ctrl_type = 521; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_UPDATE_CURSOR: virtio_gpu_ctrl_type = 768; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_CMD_MOVE_CURSOR: virtio_gpu_ctrl_type = 769; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_NODATA: virtio_gpu_ctrl_type = 4352; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_DISPLAY_INFO: virtio_gpu_ctrl_type = 4353; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET_INFO: virtio_gpu_ctrl_type = 4354; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_CAPSET: virtio_gpu_ctrl_type = 4355; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_EDID: virtio_gpu_ctrl_type = 4356; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_RESOURCE_UUID: virtio_gpu_ctrl_type = 4357; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_OK_MAP_INFO: virtio_gpu_ctrl_type = 4358; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_UNSPEC: virtio_gpu_ctrl_type = 4608; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY: virtio_gpu_ctrl_type = 4609; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_SCANOUT_ID: virtio_gpu_ctrl_type = 4610; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID: virtio_gpu_ctrl_type = 4611; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_CONTEXT_ID: virtio_gpu_ctrl_type = 4612; pub const virtio_gpu_ctrl_type_VIRTIO_GPU_RESP_ERR_INVALID_PARAMETER: virtio_gpu_ctrl_type = 4613; pub type virtio_gpu_ctrl_type = ::std::os::raw::c_uint; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_UNDEFINED: virtio_gpu_shm_id = 0; pub const virtio_gpu_shm_id_VIRTIO_GPU_SHM_ID_HOST_VISIBLE: virtio_gpu_shm_id = 1; pub type virtio_gpu_shm_id = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctrl_hdr { pub type_: __le32, pub flags: __le32, pub fence_id: __le64, pub ctx_id: __le32, pub ring_idx: __u8, pub padding: [__u8; 3usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctrl_hdr"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctrl_hdr"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::type_"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, type_) - 0usize]; ["Offset of field: virtio_gpu_ctrl_hdr::flags"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, flags) - 4usize]; ["Offset of field: virtio_gpu_ctrl_hdr::fence_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, fence_id) - 8usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ctx_id"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ctx_id) - 16usize]; ["Offset of field: virtio_gpu_ctrl_hdr::ring_idx"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, ring_idx) - 20usize]; ["Offset of field: virtio_gpu_ctrl_hdr::padding"] [::std::mem::offset_of!(virtio_gpu_ctrl_hdr, padding) - 21usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cursor_pos { pub scanout_id: __le32, pub x: __le32, pub y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cursor_pos"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_cursor_pos"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::scanout_id"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, scanout_id) - 0usize]; ["Offset of field: virtio_gpu_cursor_pos::x"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, x) - 4usize]; ["Offset of field: virtio_gpu_cursor_pos::y"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, y) - 8usize]; ["Offset of field: virtio_gpu_cursor_pos::padding"] [::std::mem::offset_of!(virtio_gpu_cursor_pos, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_update_cursor { pub hdr: virtio_gpu_ctrl_hdr, pub pos: virtio_gpu_cursor_pos, pub resource_id: __le32, pub hot_x: __le32, pub hot_y: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_update_cursor"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_update_cursor"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_update_cursor::hdr"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hdr) - 0usize]; ["Offset of field: virtio_gpu_update_cursor::pos"] [::std::mem::offset_of!(virtio_gpu_update_cursor, pos) - 24usize]; ["Offset of field: virtio_gpu_update_cursor::resource_id"] [::std::mem::offset_of!(virtio_gpu_update_cursor, resource_id) - 40usize]; ["Offset of field: virtio_gpu_update_cursor::hot_x"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_x) - 44usize]; ["Offset of field: virtio_gpu_update_cursor::hot_y"] [::std::mem::offset_of!(virtio_gpu_update_cursor, hot_y) - 48usize]; ["Offset of field: virtio_gpu_update_cursor::padding"] [::std::mem::offset_of!(virtio_gpu_update_cursor, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_rect { pub x: __le32, pub y: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_rect"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_rect"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_rect::x"][::std::mem::offset_of!(virtio_gpu_rect, x) - 0usize]; ["Offset of field: virtio_gpu_rect::y"][::std::mem::offset_of!(virtio_gpu_rect, y) - 4usize]; ["Offset of field: virtio_gpu_rect::width"] [::std::mem::offset_of!(virtio_gpu_rect, width) - 8usize]; ["Offset of field: virtio_gpu_rect::height"] [::std::mem::offset_of!(virtio_gpu_rect, height) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unref { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unref"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unref"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unref::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unref, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unref::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unref, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unref::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unref, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_2d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub format: __le32, pub width: __le32, pub height: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_2d"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_create_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_2d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, format) - 28usize]; ["Offset of field: virtio_gpu_resource_create_2d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, width) - 32usize]; ["Offset of field: virtio_gpu_resource_create_2d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_2d, height) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout"][::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_set_scanout"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout, resource_id) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_flush { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_flush"] [::std::mem::size_of::() - 48usize]; ["Alignment of virtio_gpu_resource_flush"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_flush::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_flush, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_flush::r"] [::std::mem::offset_of!(virtio_gpu_resource_flush, r) - 24usize]; ["Offset of field: virtio_gpu_resource_flush::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_flush, resource_id) - 40usize]; ["Offset of field: virtio_gpu_resource_flush::padding"] [::std::mem::offset_of!(virtio_gpu_resource_flush, padding) - 44usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_to_host_2d { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub offset: __le64, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_to_host_2d"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_transfer_to_host_2d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::r"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, r) - 24usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, offset) - 40usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, resource_id) - 48usize]; ["Offset of field: virtio_gpu_transfer_to_host_2d::padding"] [::std::mem::offset_of!(virtio_gpu_transfer_to_host_2d, padding) - 52usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_mem_entry { pub addr: __le64, pub length: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_mem_entry"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_mem_entry"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_mem_entry::addr"] [::std::mem::offset_of!(virtio_gpu_mem_entry, addr) - 0usize]; ["Offset of field: virtio_gpu_mem_entry::length"] [::std::mem::offset_of!(virtio_gpu_mem_entry, length) - 8usize]; ["Offset of field: virtio_gpu_mem_entry::padding"] [::std::mem::offset_of!(virtio_gpu_mem_entry, padding) - 12usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_attach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub nr_entries: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_attach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_attach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_attach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_attach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_attach_backing::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_attach_backing, nr_entries) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_detach_backing { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_detach_backing"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_detach_backing"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_detach_backing::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_detach_backing::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_detach_backing::padding"] [::std::mem::offset_of!(virtio_gpu_resource_detach_backing, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info { pub hdr: virtio_gpu_ctrl_hdr, pub pmodes: [virtio_gpu_resp_display_info_virtio_gpu_display_one; 16usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_display_info_virtio_gpu_display_one { pub r: virtio_gpu_rect, pub enabled: __le32, pub flags: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_display_info_virtio_gpu_display_one"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::r"] [::std::mem::offset_of!(virtio_gpu_resp_display_info_virtio_gpu_display_one, r) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::enabled"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, enabled ) - 16usize]; ["Offset of field: virtio_gpu_resp_display_info_virtio_gpu_display_one::flags"][::std::mem::offset_of!( virtio_gpu_resp_display_info_virtio_gpu_display_one, flags ) - 20usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_display_info"] [::std::mem::size_of::() - 408usize]; ["Alignment of virtio_gpu_resp_display_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_display_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_display_info::pmodes"] [::std::mem::offset_of!(virtio_gpu_resp_display_info, pmodes) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_box { pub x: __le32, pub y: __le32, pub z: __le32, pub w: __le32, pub h: __le32, pub d: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_box"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_box"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_box::x"][::std::mem::offset_of!(virtio_gpu_box, x) - 0usize]; ["Offset of field: virtio_gpu_box::y"][::std::mem::offset_of!(virtio_gpu_box, y) - 4usize]; ["Offset of field: virtio_gpu_box::z"][::std::mem::offset_of!(virtio_gpu_box, z) - 8usize]; ["Offset of field: virtio_gpu_box::w"][::std::mem::offset_of!(virtio_gpu_box, w) - 12usize]; ["Offset of field: virtio_gpu_box::h"][::std::mem::offset_of!(virtio_gpu_box, h) - 16usize]; ["Offset of field: virtio_gpu_box::d"][::std::mem::offset_of!(virtio_gpu_box, d) - 20usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_transfer_host_3d { pub hdr: virtio_gpu_ctrl_hdr, pub box_: virtio_gpu_box, pub offset: __le64, pub resource_id: __le32, pub level: __le32, pub stride: __le32, pub layer_stride: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_transfer_host_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_transfer_host_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_transfer_host_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_transfer_host_3d::box_"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, box_) - 24usize]; ["Offset of field: virtio_gpu_transfer_host_3d::offset"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, offset) - 48usize]; ["Offset of field: virtio_gpu_transfer_host_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, resource_id) - 56usize]; ["Offset of field: virtio_gpu_transfer_host_3d::level"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, level) - 60usize]; ["Offset of field: virtio_gpu_transfer_host_3d::stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, stride) - 64usize]; ["Offset of field: virtio_gpu_transfer_host_3d::layer_stride"] [::std::mem::offset_of!(virtio_gpu_transfer_host_3d, layer_stride) - 68usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_3d { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub target: __le32, pub format: __le32, pub bind: __le32, pub width: __le32, pub height: __le32, pub depth: __le32, pub array_size: __le32, pub last_level: __le32, pub nr_samples: __le32, pub flags: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_3d"] [::std::mem::size_of::() - 72usize]; ["Alignment of virtio_gpu_resource_create_3d"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_3d::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_3d::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_3d::target"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, target) - 28usize]; ["Offset of field: virtio_gpu_resource_create_3d::format"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, format) - 32usize]; ["Offset of field: virtio_gpu_resource_create_3d::bind"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, bind) - 36usize]; ["Offset of field: virtio_gpu_resource_create_3d::width"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, width) - 40usize]; ["Offset of field: virtio_gpu_resource_create_3d::height"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, height) - 44usize]; ["Offset of field: virtio_gpu_resource_create_3d::depth"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, depth) - 48usize]; ["Offset of field: virtio_gpu_resource_create_3d::array_size"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, array_size) - 52usize]; ["Offset of field: virtio_gpu_resource_create_3d::last_level"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, last_level) - 56usize]; ["Offset of field: virtio_gpu_resource_create_3d::nr_samples"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, nr_samples) - 60usize]; ["Offset of field: virtio_gpu_resource_create_3d::flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, flags) - 64usize]; ["Offset of field: virtio_gpu_resource_create_3d::padding"] [::std::mem::offset_of!(virtio_gpu_resource_create_3d, padding) - 68usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_create { pub hdr: virtio_gpu_ctrl_hdr, pub nlen: __le32, pub context_init: __le32, pub debug_name: [::std::os::raw::c_char; 64usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_create"][::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_ctx_create"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_create::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_create, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_create::nlen"] [::std::mem::offset_of!(virtio_gpu_ctx_create, nlen) - 24usize]; ["Offset of field: virtio_gpu_ctx_create::context_init"] [::std::mem::offset_of!(virtio_gpu_ctx_create, context_init) - 28usize]; ["Offset of field: virtio_gpu_ctx_create::debug_name"] [::std::mem::offset_of!(virtio_gpu_ctx_create, debug_name) - 32usize]; }; impl Default for virtio_gpu_ctx_create { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_destroy { pub hdr: virtio_gpu_ctrl_hdr, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_destroy"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_ctx_destroy"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_destroy::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_destroy, hdr) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_ctx_resource { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_ctx_resource"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_ctx_resource"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_ctx_resource::hdr"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, hdr) - 0usize]; ["Offset of field: virtio_gpu_ctx_resource::resource_id"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, resource_id) - 24usize]; ["Offset of field: virtio_gpu_ctx_resource::padding"] [::std::mem::offset_of!(virtio_gpu_ctx_resource, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_submit { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_submit"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_submit"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_submit::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_submit::size"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, size) - 24usize]; ["Offset of field: virtio_gpu_cmd_submit::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_submit, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_index: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset_info::capset_index"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, capset_index) - 24usize]; ["Offset of field: virtio_gpu_get_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_get_capset_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_capset_info { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_max_version: __le32, pub capset_max_size: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset_info"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_capset_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_id"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_id) - 24usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_version"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_version) - 28usize]; ["Offset of field: virtio_gpu_resp_capset_info::capset_max_size"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, capset_max_size) - 32usize]; ["Offset of field: virtio_gpu_resp_capset_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_capset_info, padding) - 36usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_get_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_id: __le32, pub capset_version: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_get_capset"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_get_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_get_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_get_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_get_capset::capset_id"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_id) - 24usize]; ["Offset of field: virtio_gpu_get_capset::capset_version"] [::std::mem::offset_of!(virtio_gpu_get_capset, capset_version) - 28usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_gpu_resp_capset { pub hdr: virtio_gpu_ctrl_hdr, pub capset_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_capset"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_gpu_resp_capset"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_capset::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_capset, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_capset::capset_data"] [::std::mem::offset_of!(virtio_gpu_resp_capset, capset_data) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_cmd_get_edid { pub hdr: virtio_gpu_ctrl_hdr, pub scanout: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_cmd_get_edid"][::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_cmd_get_edid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_cmd_get_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_cmd_get_edid::scanout"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, scanout) - 24usize]; ["Offset of field: virtio_gpu_cmd_get_edid::padding"] [::std::mem::offset_of!(virtio_gpu_cmd_get_edid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_edid { pub hdr: virtio_gpu_ctrl_hdr, pub size: __le32, pub padding: __le32, pub edid: [__u8; 1024usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_edid"][::std::mem::size_of::() - 1056usize]; ["Alignment of virtio_gpu_resp_edid"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_edid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_edid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_edid::size"] [::std::mem::offset_of!(virtio_gpu_resp_edid, size) - 24usize]; ["Offset of field: virtio_gpu_resp_edid::padding"] [::std::mem::offset_of!(virtio_gpu_resp_edid, padding) - 28usize]; ["Offset of field: virtio_gpu_resp_edid::edid"] [::std::mem::offset_of!(virtio_gpu_resp_edid, edid) - 32usize]; }; impl Default for virtio_gpu_resp_edid { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_config { pub events_read: __le32, pub events_clear: __le32, pub num_scanouts: __le32, pub num_capsets: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_gpu_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_gpu_config::events_read"] [::std::mem::offset_of!(virtio_gpu_config, events_read) - 0usize]; ["Offset of field: virtio_gpu_config::events_clear"] [::std::mem::offset_of!(virtio_gpu_config, events_clear) - 4usize]; ["Offset of field: virtio_gpu_config::num_scanouts"] [::std::mem::offset_of!(virtio_gpu_config, num_scanouts) - 8usize]; ["Offset of field: virtio_gpu_config::num_capsets"] [::std::mem::offset_of!(virtio_gpu_config, num_capsets) - 12usize]; }; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM: virtio_gpu_formats = 1; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM: virtio_gpu_formats = 2; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM: virtio_gpu_formats = 3; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM: virtio_gpu_formats = 4; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8A8_UNORM: virtio_gpu_formats = 67; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_X8B8G8R8_UNORM: virtio_gpu_formats = 68; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_A8B8G8R8_UNORM: virtio_gpu_formats = 121; pub const virtio_gpu_formats_VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM: virtio_gpu_formats = 134; pub type virtio_gpu_formats = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_assign_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_assign_uuid"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_assign_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_assign_uuid::padding"] [::std::mem::offset_of!(virtio_gpu_resource_assign_uuid, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_resource_uuid { pub hdr: virtio_gpu_ctrl_hdr, pub uuid: [__u8; 16usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_resource_uuid"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resp_resource_uuid"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_resource_uuid::uuid"] [::std::mem::offset_of!(virtio_gpu_resp_resource_uuid, uuid) - 24usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_create_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub blob_mem: __le32, pub blob_flags: __le32, pub nr_entries: __le32, pub blob_id: __le64, pub size: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_create_blob"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_gpu_resource_create_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_create_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_create_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_mem"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_mem) - 28usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_flags"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_flags) - 32usize]; ["Offset of field: virtio_gpu_resource_create_blob::nr_entries"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, nr_entries) - 36usize]; ["Offset of field: virtio_gpu_resource_create_blob::blob_id"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, blob_id) - 40usize]; ["Offset of field: virtio_gpu_resource_create_blob::size"] [::std::mem::offset_of!(virtio_gpu_resource_create_blob, size) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_set_scanout_blob { pub hdr: virtio_gpu_ctrl_hdr, pub r: virtio_gpu_rect, pub scanout_id: __le32, pub resource_id: __le32, pub width: __le32, pub height: __le32, pub format: __le32, pub padding: __le32, pub strides: [__le32; 4usize], pub offsets: [__le32; 4usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_set_scanout_blob"] [::std::mem::size_of::() - 96usize]; ["Alignment of virtio_gpu_set_scanout_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_set_scanout_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_set_scanout_blob::r"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, r) - 24usize]; ["Offset of field: virtio_gpu_set_scanout_blob::scanout_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, scanout_id) - 40usize]; ["Offset of field: virtio_gpu_set_scanout_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, resource_id) - 44usize]; ["Offset of field: virtio_gpu_set_scanout_blob::width"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, width) - 48usize]; ["Offset of field: virtio_gpu_set_scanout_blob::height"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, height) - 52usize]; ["Offset of field: virtio_gpu_set_scanout_blob::format"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, format) - 56usize]; ["Offset of field: virtio_gpu_set_scanout_blob::padding"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, padding) - 60usize]; ["Offset of field: virtio_gpu_set_scanout_blob::strides"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, strides) - 64usize]; ["Offset of field: virtio_gpu_set_scanout_blob::offsets"] [::std::mem::offset_of!(virtio_gpu_set_scanout_blob, offsets) - 80usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_map_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, pub offset: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_map_blob"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_gpu_resource_map_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_map_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_map_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_map_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, padding) - 28usize]; ["Offset of field: virtio_gpu_resource_map_blob::offset"] [::std::mem::offset_of!(virtio_gpu_resource_map_blob, offset) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resp_map_info { pub hdr: virtio_gpu_ctrl_hdr, pub map_info: __u32, pub padding: __u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resp_map_info"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resp_map_info"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resp_map_info::hdr"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, hdr) - 0usize]; ["Offset of field: virtio_gpu_resp_map_info::map_info"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, map_info) - 24usize]; ["Offset of field: virtio_gpu_resp_map_info::padding"] [::std::mem::offset_of!(virtio_gpu_resp_map_info, padding) - 28usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_gpu_resource_unmap_blob { pub hdr: virtio_gpu_ctrl_hdr, pub resource_id: __le32, pub padding: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_gpu_resource_unmap_blob"] [::std::mem::size_of::() - 32usize]; ["Alignment of virtio_gpu_resource_unmap_blob"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::hdr"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, hdr) - 0usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::resource_id"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, resource_id) - 24usize]; ["Offset of field: virtio_gpu_resource_unmap_blob::padding"] [::std::mem::offset_of!(virtio_gpu_resource_unmap_blob, padding) - 28usize]; }; virtio-bindings-0.2.6/src/bindings/x86_64/virtio_ids.rs000064400000000000000000000035111046102023000210030ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ 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; virtio-bindings-0.2.6/src/bindings/x86_64/virtio_input.rs000064400000000000000000000147261046102023000213750ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __le16 = __u16; pub type __le32 = __u32; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_UNSET: virtio_input_config_select = 0; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_NAME: virtio_input_config_select = 1; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_SERIAL: virtio_input_config_select = 2; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ID_DEVIDS: virtio_input_config_select = 3; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_PROP_BITS: virtio_input_config_select = 16; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_EV_BITS: virtio_input_config_select = 17; pub const virtio_input_config_select_VIRTIO_INPUT_CFG_ABS_INFO: virtio_input_config_select = 18; pub type virtio_input_config_select = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_absinfo { pub min: __le32, pub max: __le32, pub fuzz: __le32, pub flat: __le32, pub res: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_absinfo"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_input_absinfo"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_absinfo::min"] [::std::mem::offset_of!(virtio_input_absinfo, min) - 0usize]; ["Offset of field: virtio_input_absinfo::max"] [::std::mem::offset_of!(virtio_input_absinfo, max) - 4usize]; ["Offset of field: virtio_input_absinfo::fuzz"] [::std::mem::offset_of!(virtio_input_absinfo, fuzz) - 8usize]; ["Offset of field: virtio_input_absinfo::flat"] [::std::mem::offset_of!(virtio_input_absinfo, flat) - 12usize]; ["Offset of field: virtio_input_absinfo::res"] [::std::mem::offset_of!(virtio_input_absinfo, res) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_devids { pub bustype: __le16, pub vendor: __le16, pub product: __le16, pub version: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_devids"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_devids"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_input_devids::bustype"] [::std::mem::offset_of!(virtio_input_devids, bustype) - 0usize]; ["Offset of field: virtio_input_devids::vendor"] [::std::mem::offset_of!(virtio_input_devids, vendor) - 2usize]; ["Offset of field: virtio_input_devids::product"] [::std::mem::offset_of!(virtio_input_devids, product) - 4usize]; ["Offset of field: virtio_input_devids::version"] [::std::mem::offset_of!(virtio_input_devids, version) - 6usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_input_config { pub select: __u8, pub subsel: __u8, pub size: __u8, pub reserved: [__u8; 5usize], pub u: virtio_input_config__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_input_config__bindgen_ty_1 { pub string: [::std::os::raw::c_char; 128usize], pub bitmap: [__u8; 128usize], pub abs: virtio_input_absinfo, pub ids: virtio_input_devids, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config__bindgen_ty_1"] [::std::mem::size_of::() - 128usize]; ["Alignment of virtio_input_config__bindgen_ty_1"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::string"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, string) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::bitmap"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, bitmap) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::abs"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, abs) - 0usize]; ["Offset of field: virtio_input_config__bindgen_ty_1::ids"] [::std::mem::offset_of!(virtio_input_config__bindgen_ty_1, ids) - 0usize]; }; impl Default for virtio_input_config__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_config"][::std::mem::size_of::() - 136usize]; ["Alignment of virtio_input_config"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_config::select"] [::std::mem::offset_of!(virtio_input_config, select) - 0usize]; ["Offset of field: virtio_input_config::subsel"] [::std::mem::offset_of!(virtio_input_config, subsel) - 1usize]; ["Offset of field: virtio_input_config::size"] [::std::mem::offset_of!(virtio_input_config, size) - 2usize]; ["Offset of field: virtio_input_config::reserved"] [::std::mem::offset_of!(virtio_input_config, reserved) - 3usize]; ["Offset of field: virtio_input_config::u"] [::std::mem::offset_of!(virtio_input_config, u) - 8usize]; }; impl Default for virtio_input_config { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_input_event { pub type_: __le16, pub code: __le16, pub value: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_input_event"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_input_event"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_input_event::type_"] [::std::mem::offset_of!(virtio_input_event, type_) - 0usize]; ["Offset of field: virtio_input_event::code"] [::std::mem::offset_of!(virtio_input_event, code) - 2usize]; ["Offset of field: virtio_input_event::value"] [::std::mem::offset_of!(virtio_input_event, value) - 4usize]; }; virtio-bindings-0.2.6/src/bindings/x86_64/virtio_mmio.rs000064400000000000000000000031421046102023000211650ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_MMIO_MAGIC_VALUE: u32 = 0; pub const VIRTIO_MMIO_VERSION: u32 = 4; pub const VIRTIO_MMIO_DEVICE_ID: u32 = 8; pub const VIRTIO_MMIO_VENDOR_ID: u32 = 12; pub const VIRTIO_MMIO_DEVICE_FEATURES: u32 = 16; pub const VIRTIO_MMIO_DEVICE_FEATURES_SEL: u32 = 20; pub const VIRTIO_MMIO_DRIVER_FEATURES: u32 = 32; pub const VIRTIO_MMIO_DRIVER_FEATURES_SEL: u32 = 36; pub const VIRTIO_MMIO_GUEST_PAGE_SIZE: u32 = 40; pub const VIRTIO_MMIO_QUEUE_SEL: u32 = 48; pub const VIRTIO_MMIO_QUEUE_NUM_MAX: u32 = 52; pub const VIRTIO_MMIO_QUEUE_NUM: u32 = 56; pub const VIRTIO_MMIO_QUEUE_ALIGN: u32 = 60; pub const VIRTIO_MMIO_QUEUE_PFN: u32 = 64; pub const VIRTIO_MMIO_QUEUE_READY: u32 = 68; pub const VIRTIO_MMIO_QUEUE_NOTIFY: u32 = 80; pub const VIRTIO_MMIO_INTERRUPT_STATUS: u32 = 96; pub const VIRTIO_MMIO_INTERRUPT_ACK: u32 = 100; pub const VIRTIO_MMIO_STATUS: u32 = 112; pub const VIRTIO_MMIO_QUEUE_DESC_LOW: u32 = 128; pub const VIRTIO_MMIO_QUEUE_DESC_HIGH: u32 = 132; pub const VIRTIO_MMIO_QUEUE_AVAIL_LOW: u32 = 144; pub const VIRTIO_MMIO_QUEUE_AVAIL_HIGH: u32 = 148; pub const VIRTIO_MMIO_QUEUE_USED_LOW: u32 = 160; pub const VIRTIO_MMIO_QUEUE_USED_HIGH: u32 = 164; pub const VIRTIO_MMIO_SHM_SEL: u32 = 172; pub const VIRTIO_MMIO_SHM_LEN_LOW: u32 = 176; pub const VIRTIO_MMIO_SHM_LEN_HIGH: u32 = 180; pub const VIRTIO_MMIO_SHM_BASE_LOW: u32 = 184; pub const VIRTIO_MMIO_SHM_BASE_HIGH: u32 = 188; pub const VIRTIO_MMIO_CONFIG_GENERATION: u32 = 252; pub const VIRTIO_MMIO_CONFIG: u32 = 256; pub const VIRTIO_MMIO_INT_VRING: u32 = 1; pub const VIRTIO_MMIO_INT_CONFIG: u32 = 2; virtio-bindings-0.2.6/src/bindings/x86_64/virtio_net.rs000064400000000000000000001227671046102023000210310ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VIRTIO_NET_F_CSUM: u32 = 0; pub const VIRTIO_NET_F_GUEST_CSUM: u32 = 1; pub const VIRTIO_NET_F_CTRL_GUEST_OFFLOADS: u32 = 2; pub const VIRTIO_NET_F_MTU: u32 = 3; pub const VIRTIO_NET_F_MAC: u32 = 5; pub const VIRTIO_NET_F_GUEST_TSO4: u32 = 7; pub const VIRTIO_NET_F_GUEST_TSO6: u32 = 8; pub const VIRTIO_NET_F_GUEST_ECN: u32 = 9; pub const VIRTIO_NET_F_GUEST_UFO: u32 = 10; pub const VIRTIO_NET_F_HOST_TSO4: u32 = 11; pub const VIRTIO_NET_F_HOST_TSO6: u32 = 12; pub const VIRTIO_NET_F_HOST_ECN: u32 = 13; pub const VIRTIO_NET_F_HOST_UFO: u32 = 14; pub const VIRTIO_NET_F_MRG_RXBUF: u32 = 15; pub const VIRTIO_NET_F_STATUS: u32 = 16; pub const VIRTIO_NET_F_CTRL_VQ: u32 = 17; pub const VIRTIO_NET_F_CTRL_RX: u32 = 18; pub const VIRTIO_NET_F_CTRL_VLAN: u32 = 19; pub const VIRTIO_NET_F_CTRL_RX_EXTRA: u32 = 20; pub const VIRTIO_NET_F_GUEST_ANNOUNCE: u32 = 21; pub const VIRTIO_NET_F_MQ: u32 = 22; pub const VIRTIO_NET_F_CTRL_MAC_ADDR: u32 = 23; pub const VIRTIO_NET_F_DEVICE_STATS: u32 = 50; pub const VIRTIO_NET_F_VQ_NOTF_COAL: u32 = 52; pub const VIRTIO_NET_F_NOTF_COAL: u32 = 53; pub const VIRTIO_NET_F_GUEST_USO4: u32 = 54; pub const VIRTIO_NET_F_GUEST_USO6: u32 = 55; pub const VIRTIO_NET_F_HOST_USO: u32 = 56; pub const VIRTIO_NET_F_HASH_REPORT: u32 = 57; pub const VIRTIO_NET_F_GUEST_HDRLEN: u32 = 59; pub const VIRTIO_NET_F_RSS: u32 = 60; pub const VIRTIO_NET_F_RSC_EXT: u32 = 61; pub const VIRTIO_NET_F_STANDBY: u32 = 62; pub const VIRTIO_NET_F_SPEED_DUPLEX: u32 = 63; pub const VIRTIO_NET_F_GSO: u32 = 6; pub const VIRTIO_NET_S_LINK_UP: u32 = 1; pub const VIRTIO_NET_S_ANNOUNCE: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv4: u32 = 1; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv4: u32 = 2; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv4: u32 = 4; pub const VIRTIO_NET_RSS_HASH_TYPE_IPv6: u32 = 8; pub const VIRTIO_NET_RSS_HASH_TYPE_TCPv6: u32 = 16; pub const VIRTIO_NET_RSS_HASH_TYPE_UDPv6: u32 = 32; pub const VIRTIO_NET_RSS_HASH_TYPE_IP_EX: u32 = 64; pub const VIRTIO_NET_RSS_HASH_TYPE_TCP_EX: u32 = 128; pub const VIRTIO_NET_RSS_HASH_TYPE_UDP_EX: u32 = 256; pub const VIRTIO_NET_HDR_F_NEEDS_CSUM: u32 = 1; pub const VIRTIO_NET_HDR_F_DATA_VALID: u32 = 2; pub const VIRTIO_NET_HDR_F_RSC_INFO: u32 = 4; pub const VIRTIO_NET_HDR_GSO_NONE: u32 = 0; pub const VIRTIO_NET_HDR_GSO_TCPV4: u32 = 1; pub const VIRTIO_NET_HDR_GSO_UDP: u32 = 3; pub const VIRTIO_NET_HDR_GSO_TCPV6: u32 = 4; pub const VIRTIO_NET_HDR_GSO_UDP_L4: u32 = 5; pub const VIRTIO_NET_HDR_GSO_ECN: u32 = 128; pub const VIRTIO_NET_HASH_REPORT_NONE: u32 = 0; pub const VIRTIO_NET_HASH_REPORT_IPv4: u32 = 1; pub const VIRTIO_NET_HASH_REPORT_TCPv4: u32 = 2; pub const VIRTIO_NET_HASH_REPORT_UDPv4: u32 = 3; pub const VIRTIO_NET_HASH_REPORT_IPv6: u32 = 4; pub const VIRTIO_NET_HASH_REPORT_TCPv6: u32 = 5; pub const VIRTIO_NET_HASH_REPORT_UDPv6: u32 = 6; pub const VIRTIO_NET_HASH_REPORT_IPv6_EX: u32 = 7; pub const VIRTIO_NET_HASH_REPORT_TCPv6_EX: u32 = 8; pub const VIRTIO_NET_HASH_REPORT_UDPv6_EX: u32 = 9; pub const VIRTIO_NET_OK: u32 = 0; pub const VIRTIO_NET_ERR: u32 = 1; pub const VIRTIO_NET_CTRL_RX: u32 = 0; pub const VIRTIO_NET_CTRL_RX_PROMISC: u32 = 0; pub const VIRTIO_NET_CTRL_RX_ALLMULTI: u32 = 1; pub const VIRTIO_NET_CTRL_RX_ALLUNI: u32 = 2; pub const VIRTIO_NET_CTRL_RX_NOMULTI: u32 = 3; pub const VIRTIO_NET_CTRL_RX_NOUNI: u32 = 4; pub const VIRTIO_NET_CTRL_RX_NOBCAST: u32 = 5; pub const VIRTIO_NET_CTRL_MAC: u32 = 1; pub const VIRTIO_NET_CTRL_MAC_TABLE_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MAC_ADDR_SET: u32 = 1; pub const VIRTIO_NET_CTRL_VLAN: u32 = 2; pub const VIRTIO_NET_CTRL_VLAN_ADD: u32 = 0; pub const VIRTIO_NET_CTRL_VLAN_DEL: u32 = 1; pub const VIRTIO_NET_CTRL_ANNOUNCE: u32 = 3; pub const VIRTIO_NET_CTRL_ANNOUNCE_ACK: u32 = 0; pub const VIRTIO_NET_CTRL_MQ: u32 = 4; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX: u32 = 32768; pub const VIRTIO_NET_CTRL_MQ_RSS_CONFIG: u32 = 1; pub const VIRTIO_NET_CTRL_MQ_HASH_CONFIG: u32 = 2; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS: u32 = 5; pub const VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL: u32 = 6; pub const VIRTIO_NET_CTRL_NOTF_COAL_TX_SET: u32 = 0; pub const VIRTIO_NET_CTRL_NOTF_COAL_RX_SET: u32 = 1; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_SET: u32 = 2; pub const VIRTIO_NET_CTRL_NOTF_COAL_VQ_GET: u32 = 3; pub const VIRTIO_NET_CTRL_STATS: u32 = 8; pub const VIRTIO_NET_CTRL_STATS_QUERY: u32 = 0; pub const VIRTIO_NET_CTRL_STATS_GET: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_CVQ: u64 = 4294967296; pub const VIRTIO_NET_STATS_TYPE_RX_BASIC: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_RX_CSUM: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_RX_GSO: u32 = 4; pub const VIRTIO_NET_STATS_TYPE_RX_SPEED: u32 = 8; pub const VIRTIO_NET_STATS_TYPE_TX_BASIC: u32 = 65536; pub const VIRTIO_NET_STATS_TYPE_TX_CSUM: u32 = 131072; pub const VIRTIO_NET_STATS_TYPE_TX_GSO: u32 = 262144; pub const VIRTIO_NET_STATS_TYPE_TX_SPEED: u32 = 524288; pub const VIRTIO_NET_STATS_TYPE_REPLY_CVQ: u32 = 32; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC: u32 = 0; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM: u32 = 1; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO: u32 = 2; pub const VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED: u32 = 3; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC: u32 = 16; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM: u32 = 17; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO: u32 = 18; pub const VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED: u32 = 19; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_config { pub mac: [__u8; 6usize], pub status: __virtio16, pub max_virtqueue_pairs: __virtio16, pub mtu: __virtio16, pub speed: __le32, pub duplex: __u8, pub rss_max_key_size: __u8, pub rss_max_indirection_table_length: __le16, pub supported_hash_types: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_config"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_config::mac"] [::std::mem::offset_of!(virtio_net_config, mac) - 0usize]; ["Offset of field: virtio_net_config::status"] [::std::mem::offset_of!(virtio_net_config, status) - 6usize]; ["Offset of field: virtio_net_config::max_virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_config, max_virtqueue_pairs) - 8usize]; ["Offset of field: virtio_net_config::mtu"] [::std::mem::offset_of!(virtio_net_config, mtu) - 10usize]; ["Offset of field: virtio_net_config::speed"] [::std::mem::offset_of!(virtio_net_config, speed) - 12usize]; ["Offset of field: virtio_net_config::duplex"] [::std::mem::offset_of!(virtio_net_config, duplex) - 16usize]; ["Offset of field: virtio_net_config::rss_max_key_size"] [::std::mem::offset_of!(virtio_net_config, rss_max_key_size) - 17usize]; ["Offset of field: virtio_net_config::rss_max_indirection_table_length"] [::std::mem::offset_of!(virtio_net_config, rss_max_indirection_table_length) - 18usize]; ["Offset of field: virtio_net_config::supported_hash_types"] [::std::mem::offset_of!(virtio_net_config, supported_hash_types) - 20usize]; }; #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1 { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1, pub num_buffers: __virtio16, } #[repr(C)] #[derive(Copy, Clone)] pub union virtio_net_hdr_v1__bindgen_ty_1 { pub __bindgen_anon_1: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, pub csum: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, pub rsc: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1 { pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_start"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_start ) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1::csum_offset"][::std::mem::offset_of!( virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_1, csum_offset ) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2 { pub start: __virtio16, pub offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::start"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, start) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2::offset"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_2, offset) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3 { pub segments: __le16, pub dup_acks: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::segments"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, segments) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3::dup_acks"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1__bindgen_ty_3, dup_acks) - 2usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_hdr_v1__bindgen_ty_1"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::csum"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, csum) - 0usize]; ["Offset of field: virtio_net_hdr_v1__bindgen_ty_1::rsc"] [::std::mem::offset_of!(virtio_net_hdr_v1__bindgen_ty_1, rsc) - 0usize]; }; impl Default for virtio_net_hdr_v1__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_v1"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_v1::flags"] [::std::mem::offset_of!(virtio_net_hdr_v1, flags) - 0usize]; ["Offset of field: virtio_net_hdr_v1::gso_type"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr_v1::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr_v1, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr_v1::gso_size"] [::std::mem::offset_of!(virtio_net_hdr_v1, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr_v1::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_v1, num_buffers) - 10usize]; }; impl Default for virtio_net_hdr_v1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct virtio_net_hdr_v1_hash { pub hdr: virtio_net_hdr_v1, pub hash_value: __le32, pub hash_report: __le16, pub padding: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_v1_hash"][::std::mem::size_of::() - 20usize]; ["Alignment of virtio_net_hdr_v1_hash"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hdr_v1_hash::hdr"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_value"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_value) - 12usize]; ["Offset of field: virtio_net_hdr_v1_hash::hash_report"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, hash_report) - 16usize]; ["Offset of field: virtio_net_hdr_v1_hash::padding"] [::std::mem::offset_of!(virtio_net_hdr_v1_hash, padding) - 18usize]; }; impl Default for virtio_net_hdr_v1_hash { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr { pub flags: __u8, pub gso_type: __u8, pub hdr_len: __virtio16, pub gso_size: __virtio16, pub csum_start: __virtio16, pub csum_offset: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr"][::std::mem::size_of::() - 10usize]; ["Alignment of virtio_net_hdr"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr::flags"] [::std::mem::offset_of!(virtio_net_hdr, flags) - 0usize]; ["Offset of field: virtio_net_hdr::gso_type"] [::std::mem::offset_of!(virtio_net_hdr, gso_type) - 1usize]; ["Offset of field: virtio_net_hdr::hdr_len"] [::std::mem::offset_of!(virtio_net_hdr, hdr_len) - 2usize]; ["Offset of field: virtio_net_hdr::gso_size"] [::std::mem::offset_of!(virtio_net_hdr, gso_size) - 4usize]; ["Offset of field: virtio_net_hdr::csum_start"] [::std::mem::offset_of!(virtio_net_hdr, csum_start) - 6usize]; ["Offset of field: virtio_net_hdr::csum_offset"] [::std::mem::offset_of!(virtio_net_hdr, csum_offset) - 8usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_hdr_mrg_rxbuf { pub hdr: virtio_net_hdr, pub num_buffers: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hdr_mrg_rxbuf"] [::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_hdr_mrg_rxbuf"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::hdr"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, hdr) - 0usize]; ["Offset of field: virtio_net_hdr_mrg_rxbuf::num_buffers"] [::std::mem::offset_of!(virtio_net_hdr_mrg_rxbuf, num_buffers) - 10usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_hdr { pub class: __u8, pub cmd: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_hdr"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_hdr"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_hdr::class"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, class) - 0usize]; ["Offset of field: virtio_net_ctrl_hdr::cmd"] [::std::mem::offset_of!(virtio_net_ctrl_hdr, cmd) - 1usize]; }; pub type virtio_net_ctrl_ack = __u8; #[repr(C, packed)] pub struct virtio_net_ctrl_mac { pub entries: __virtio32, pub macs: __IncompleteArrayField<[__u8; 6usize]>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mac"][::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_ctrl_mac"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_net_ctrl_mac::entries"] [::std::mem::offset_of!(virtio_net_ctrl_mac, entries) - 0usize]; ["Offset of field: virtio_net_ctrl_mac::macs"] [::std::mem::offset_of!(virtio_net_ctrl_mac, macs) - 4usize]; }; impl Default for virtio_net_ctrl_mac { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_mq { pub virtqueue_pairs: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_mq"][::std::mem::size_of::() - 2usize]; ["Alignment of virtio_net_ctrl_mq"][::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_ctrl_mq::virtqueue_pairs"] [::std::mem::offset_of!(virtio_net_ctrl_mq, virtqueue_pairs) - 0usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: [__le16; 1usize], pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_rss_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config, indirection_table) - 8usize]; ["Offset of field: virtio_net_rss_config::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config, max_tx_vq) - 10usize]; ["Offset of field: virtio_net_rss_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_rss_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_hdr { pub hash_types: __le32, pub indirection_table_mask: __le16, pub unclassified_queue: __le16, pub indirection_table: __IncompleteArrayField<__le16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_rss_config_hdr"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::hash_types"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, hash_types) - 0usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table_mask"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table_mask) - 4usize]; ["Offset of field: virtio_net_rss_config_hdr::unclassified_queue"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, unclassified_queue) - 6usize]; ["Offset of field: virtio_net_rss_config_hdr::indirection_table"] [::std::mem::offset_of!(virtio_net_rss_config_hdr, indirection_table) - 8usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_rss_config_trailer { pub max_tx_vq: __le16, pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_rss_config_trailer"] [::std::mem::size_of::() - 4usize]; ["Alignment of virtio_net_rss_config_trailer"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::max_tx_vq"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, max_tx_vq) - 0usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_length"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_length) - 2usize]; ["Offset of field: virtio_net_rss_config_trailer::hash_key_data"] [::std::mem::offset_of!(virtio_net_rss_config_trailer, hash_key_data) - 3usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct virtio_net_hash_config { pub hash_types: __le32, pub reserved: [__le16; 4usize], pub hash_key_length: __u8, pub hash_key_data: __IncompleteArrayField<__u8>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_hash_config"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_hash_config"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_hash_config::hash_types"] [::std::mem::offset_of!(virtio_net_hash_config, hash_types) - 0usize]; ["Offset of field: virtio_net_hash_config::reserved"] [::std::mem::offset_of!(virtio_net_hash_config, reserved) - 4usize]; ["Offset of field: virtio_net_hash_config::hash_key_length"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_length) - 12usize]; ["Offset of field: virtio_net_hash_config::hash_key_data"] [::std::mem::offset_of!(virtio_net_hash_config, hash_key_data) - 13usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_tx { pub tx_max_packets: __le32, pub tx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_tx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_tx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_tx::tx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_tx, tx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_rx { pub rx_max_packets: __le32, pub rx_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_rx"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal_rx"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_rx::rx_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal_rx, rx_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal { pub max_packets: __le32, pub max_usecs: __le32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal"][::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_ctrl_coal"][::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal::max_packets"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_packets) - 0usize]; ["Offset of field: virtio_net_ctrl_coal::max_usecs"] [::std::mem::offset_of!(virtio_net_ctrl_coal, max_usecs) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_coal_vq { pub vqn: __le16, pub reserved: __le16, pub coal: virtio_net_ctrl_coal, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_coal_vq"][::std::mem::size_of::() - 12usize]; ["Alignment of virtio_net_ctrl_coal_vq"] [::std::mem::align_of::() - 4usize]; ["Offset of field: virtio_net_ctrl_coal_vq::vqn"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, vqn) - 0usize]; ["Offset of field: virtio_net_ctrl_coal_vq::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_coal_vq::coal"] [::std::mem::offset_of!(virtio_net_ctrl_coal_vq, coal) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_capabilities { pub supported_stats_types: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_capabilities"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_capabilities"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_capabilities::supported_stats_types"] [::std::mem::offset_of!(virtio_net_stats_capabilities, supported_stats_types) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats { pub stats: [virtio_net_ctrl_queue_stats__bindgen_ty_1; 1usize], } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_ctrl_queue_stats__bindgen_ty_1 { pub vq_index: __le16, pub reserved: [__le16; 3usize], pub types_bitmap: [__le64; 1usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats__bindgen_ty_1"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::vq_index"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, vq_index) - 0usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::reserved"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, reserved) - 2usize]; ["Offset of field: virtio_net_ctrl_queue_stats__bindgen_ty_1::types_bitmap"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats__bindgen_ty_1, types_bitmap) - 8usize]; }; #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_ctrl_queue_stats"] [::std::mem::size_of::() - 16usize]; ["Alignment of virtio_net_ctrl_queue_stats"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_ctrl_queue_stats::stats"] [::std::mem::offset_of!(virtio_net_ctrl_queue_stats, stats) - 0usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_reply_hdr { pub type_: __u8, pub reserved: __u8, pub vq_index: __le16, pub reserved1: __le16, pub size: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_reply_hdr"] [::std::mem::size_of::() - 8usize]; ["Alignment of virtio_net_stats_reply_hdr"] [::std::mem::align_of::() - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::type_"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, type_) - 0usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved) - 1usize]; ["Offset of field: virtio_net_stats_reply_hdr::vq_index"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, vq_index) - 2usize]; ["Offset of field: virtio_net_stats_reply_hdr::reserved1"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, reserved1) - 4usize]; ["Offset of field: virtio_net_stats_reply_hdr::size"] [::std::mem::offset_of!(virtio_net_stats_reply_hdr, size) - 6usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_cvq { pub hdr: virtio_net_stats_reply_hdr, pub command_num: __le64, pub ok_num: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_cvq"][::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_cvq"][::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_cvq::hdr"] [::std::mem::offset_of!(virtio_net_stats_cvq, hdr) - 0usize]; ["Offset of field: virtio_net_stats_cvq::command_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, command_num) - 8usize]; ["Offset of field: virtio_net_stats_cvq::ok_num"] [::std::mem::offset_of!(virtio_net_stats_cvq, ok_num) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_basic { pub hdr: virtio_net_stats_reply_hdr, pub rx_notifications: __le64, pub rx_packets: __le64, pub rx_bytes: __le64, pub rx_interrupts: __le64, pub rx_drops: __le64, pub rx_drop_overruns: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_rx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_notifications"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_packets) - 16usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drops"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drops) - 40usize]; ["Offset of field: virtio_net_stats_rx_basic::rx_drop_overruns"] [::std::mem::offset_of!(virtio_net_stats_rx_basic, rx_drop_overruns) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_basic { pub hdr: virtio_net_stats_reply_hdr, pub tx_notifications: __le64, pub tx_packets: __le64, pub tx_bytes: __le64, pub tx_interrupts: __le64, pub tx_drops: __le64, pub tx_drop_malformed: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_basic"] [::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_basic"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_notifications"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_notifications) - 8usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_packets) - 16usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_bytes) - 24usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_interrupts"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_interrupts) - 32usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drops"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drops) - 40usize]; ["Offset of field: virtio_net_stats_tx_basic::tx_drop_malformed"] [::std::mem::offset_of!(virtio_net_stats_tx_basic, tx_drop_malformed) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_csum { pub hdr: virtio_net_stats_reply_hdr, pub rx_csum_valid: __le64, pub rx_needs_csum: __le64, pub rx_csum_none: __le64, pub rx_csum_bad: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_csum"] [::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_valid"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_valid) - 8usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_needs_csum) - 16usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_none) - 24usize]; ["Offset of field: virtio_net_stats_rx_csum::rx_csum_bad"] [::std::mem::offset_of!(virtio_net_stats_rx_csum, rx_csum_bad) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_csum { pub hdr: virtio_net_stats_reply_hdr, pub tx_csum_none: __le64, pub tx_needs_csum: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_csum"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_csum"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_csum_none"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_csum_none) - 8usize]; ["Offset of field: virtio_net_stats_tx_csum::tx_needs_csum"] [::std::mem::offset_of!(virtio_net_stats_tx_csum, tx_needs_csum) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_gso { pub hdr: virtio_net_stats_reply_hdr, pub rx_gso_packets: __le64, pub rx_gso_bytes: __le64, pub rx_gso_packets_coalesced: __le64, pub rx_gso_bytes_coalesced: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_gso"][::std::mem::size_of::() - 40usize]; ["Alignment of virtio_net_stats_rx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_packets_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_packets_coalesced) - 24usize]; ["Offset of field: virtio_net_stats_rx_gso::rx_gso_bytes_coalesced"] [::std::mem::offset_of!(virtio_net_stats_rx_gso, rx_gso_bytes_coalesced) - 32usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_gso { pub hdr: virtio_net_stats_reply_hdr, pub tx_gso_packets: __le64, pub tx_gso_bytes: __le64, pub tx_gso_segments: __le64, pub tx_gso_segments_bytes: __le64, pub tx_gso_packets_noseg: __le64, pub tx_gso_bytes_noseg: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_gso"][::std::mem::size_of::() - 56usize]; ["Alignment of virtio_net_stats_tx_gso"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes) - 16usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments) - 24usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_segments_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_segments_bytes) - 32usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_packets_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_packets_noseg) - 40usize]; ["Offset of field: virtio_net_stats_tx_gso::tx_gso_bytes_noseg"] [::std::mem::offset_of!(virtio_net_stats_tx_gso, tx_gso_bytes_noseg) - 48usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_rx_speed { pub hdr: virtio_net_stats_reply_hdr, pub rx_ratelimit_packets: __le64, pub rx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_rx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_rx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_rx_speed::rx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_rx_speed, rx_ratelimit_bytes) - 16usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_net_stats_tx_speed { pub hdr: virtio_net_stats_reply_hdr, pub tx_ratelimit_packets: __le64, pub tx_ratelimit_bytes: __le64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_net_stats_tx_speed"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_net_stats_tx_speed"] [::std::mem::align_of::() - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::hdr"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, hdr) - 0usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_packets"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_packets) - 8usize]; ["Offset of field: virtio_net_stats_tx_speed::tx_ratelimit_bytes"] [::std::mem::offset_of!(virtio_net_stats_tx_speed, tx_ratelimit_bytes) - 16usize]; }; virtio-bindings-0.2.6/src/bindings/x86_64/virtio_ring.rs000064400000000000000000000201301046102023000211570ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); impl __IncompleteArrayField { #[inline] pub const fn new() -> Self { __IncompleteArrayField(::std::marker::PhantomData, []) } #[inline] pub fn as_ptr(&self) -> *const T { self as *const _ as *const T } #[inline] pub fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut T } #[inline] pub unsafe fn as_slice(&self, len: usize) -> &[T] { ::std::slice::from_raw_parts(self.as_ptr(), len) } #[inline] pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) } } impl ::std::fmt::Debug for __IncompleteArrayField { fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { fmt.write_str("__IncompleteArrayField") } } pub const VRING_DESC_F_NEXT: u32 = 1; pub const VRING_DESC_F_WRITE: u32 = 2; pub const VRING_DESC_F_INDIRECT: u32 = 4; pub const VRING_PACKED_DESC_F_AVAIL: u32 = 7; pub const VRING_PACKED_DESC_F_USED: u32 = 15; pub const VRING_USED_F_NO_NOTIFY: u32 = 1; pub const VRING_AVAIL_F_NO_INTERRUPT: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_ENABLE: u32 = 0; pub const VRING_PACKED_EVENT_FLAG_DISABLE: u32 = 1; pub const VRING_PACKED_EVENT_FLAG_DESC: u32 = 2; pub const VRING_PACKED_EVENT_F_WRAP_CTR: u32 = 15; pub const VIRTIO_RING_F_INDIRECT_DESC: u32 = 28; pub const VIRTIO_RING_F_EVENT_IDX: u32 = 29; pub const VRING_AVAIL_ALIGN_SIZE: u32 = 2; pub const VRING_USED_ALIGN_SIZE: u32 = 4; pub const VRING_DESC_ALIGN_SIZE: u32 = 16; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __le16 = __u16; pub type __le32 = __u32; pub type __le64 = __u64; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_desc { pub addr: __virtio64, pub len: __virtio32, pub flags: __virtio16, pub next: __virtio16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_desc::addr"][::std::mem::offset_of!(vring_desc, addr) - 0usize]; ["Offset of field: vring_desc::len"][::std::mem::offset_of!(vring_desc, len) - 8usize]; ["Offset of field: vring_desc::flags"][::std::mem::offset_of!(vring_desc, flags) - 12usize]; ["Offset of field: vring_desc::next"][::std::mem::offset_of!(vring_desc, next) - 14usize]; }; #[repr(C)] #[derive(Debug, Default)] pub struct vring_avail { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField<__virtio16>, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_avail"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_avail"][::std::mem::align_of::() - 2usize]; ["Offset of field: vring_avail::flags"][::std::mem::offset_of!(vring_avail, flags) - 0usize]; ["Offset of field: vring_avail::idx"][::std::mem::offset_of!(vring_avail, idx) - 2usize]; ["Offset of field: vring_avail::ring"][::std::mem::offset_of!(vring_avail, ring) - 4usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_used_elem { pub id: __virtio32, pub len: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used_elem"][::std::mem::size_of::() - 8usize]; ["Alignment of vring_used_elem"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used_elem::id"][::std::mem::offset_of!(vring_used_elem, id) - 0usize]; ["Offset of field: vring_used_elem::len"] [::std::mem::offset_of!(vring_used_elem, len) - 4usize]; }; pub type vring_used_elem_t = vring_used_elem; #[repr(C)] #[derive(Debug, Default)] pub struct vring_used { pub flags: __virtio16, pub idx: __virtio16, pub ring: __IncompleteArrayField, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_used"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_used"][::std::mem::align_of::() - 4usize]; ["Offset of field: vring_used::flags"][::std::mem::offset_of!(vring_used, flags) - 0usize]; ["Offset of field: vring_used::idx"][::std::mem::offset_of!(vring_used, idx) - 2usize]; ["Offset of field: vring_used::ring"][::std::mem::offset_of!(vring_used, ring) - 4usize]; }; #[doc = " struct vring_desc - Virtio ring descriptors,\n 16 bytes long. These can chain together via @next.\n\n @addr: buffer address (guest-physical)\n @len: buffer length\n @flags: descriptor flags\n @next: index of the next descriptor in the chain,\n if the VRING_DESC_F_NEXT flag is set. We chain unused\n descriptors via this, too."] pub type vring_desc_t = vring_desc; pub type vring_avail_t = vring_avail; pub type vring_used_t = vring_used; #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct vring { pub num: ::std::os::raw::c_uint, pub desc: *mut vring_desc_t, pub avail: *mut vring_avail_t, pub used: *mut vring_used_t, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring"][::std::mem::size_of::() - 32usize]; ["Alignment of vring"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring::num"][::std::mem::offset_of!(vring, num) - 0usize]; ["Offset of field: vring::desc"][::std::mem::offset_of!(vring, desc) - 8usize]; ["Offset of field: vring::avail"][::std::mem::offset_of!(vring, avail) - 16usize]; ["Offset of field: vring::used"][::std::mem::offset_of!(vring, used) - 24usize]; }; impl Default for vring { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc_event { pub off_wrap: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc_event"][::std::mem::size_of::() - 4usize]; ["Alignment of vring_packed_desc_event"] [::std::mem::align_of::() - 2usize]; ["Offset of field: vring_packed_desc_event::off_wrap"] [::std::mem::offset_of!(vring_packed_desc_event, off_wrap) - 0usize]; ["Offset of field: vring_packed_desc_event::flags"] [::std::mem::offset_of!(vring_packed_desc_event, flags) - 2usize]; }; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct vring_packed_desc { pub addr: __le64, pub len: __le32, pub id: __le16, pub flags: __le16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of vring_packed_desc"][::std::mem::size_of::() - 16usize]; ["Alignment of vring_packed_desc"][::std::mem::align_of::() - 8usize]; ["Offset of field: vring_packed_desc::addr"] [::std::mem::offset_of!(vring_packed_desc, addr) - 0usize]; ["Offset of field: vring_packed_desc::len"] [::std::mem::offset_of!(vring_packed_desc, len) - 8usize]; ["Offset of field: vring_packed_desc::id"] [::std::mem::offset_of!(vring_packed_desc, id) - 12usize]; ["Offset of field: vring_packed_desc::flags"] [::std::mem::offset_of!(vring_packed_desc, flags) - 14usize]; }; virtio-bindings-0.2.6/src/bindings/x86_64/virtio_scsi.rs000064400000000000000000000312641046102023000211730ustar 00000000000000/* automatically generated by rust-bindgen 0.71.1 */ pub const VIRTIO_SCSI_CDB_DEFAULT_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_DEFAULT_SIZE: u32 = 96; pub const VIRTIO_SCSI_CDB_SIZE: u32 = 32; pub const VIRTIO_SCSI_SENSE_SIZE: u32 = 96; pub const VIRTIO_SCSI_F_INOUT: u32 = 0; pub const VIRTIO_SCSI_F_HOTPLUG: u32 = 1; pub const VIRTIO_SCSI_F_CHANGE: u32 = 2; pub const VIRTIO_SCSI_F_T10_PI: u32 = 3; pub const VIRTIO_SCSI_S_OK: u32 = 0; pub const VIRTIO_SCSI_S_OVERRUN: u32 = 1; pub const VIRTIO_SCSI_S_ABORTED: u32 = 2; pub const VIRTIO_SCSI_S_BAD_TARGET: u32 = 3; pub const VIRTIO_SCSI_S_RESET: u32 = 4; pub const VIRTIO_SCSI_S_BUSY: u32 = 5; pub const VIRTIO_SCSI_S_TRANSPORT_FAILURE: u32 = 6; pub const VIRTIO_SCSI_S_TARGET_FAILURE: u32 = 7; pub const VIRTIO_SCSI_S_NEXUS_FAILURE: u32 = 8; pub const VIRTIO_SCSI_S_FAILURE: u32 = 9; pub const VIRTIO_SCSI_S_FUNCTION_SUCCEEDED: u32 = 10; pub const VIRTIO_SCSI_S_FUNCTION_REJECTED: u32 = 11; pub const VIRTIO_SCSI_S_INCORRECT_LUN: u32 = 12; pub const VIRTIO_SCSI_T_TMF: u32 = 0; pub const VIRTIO_SCSI_T_AN_QUERY: u32 = 1; pub const VIRTIO_SCSI_T_AN_SUBSCRIBE: u32 = 2; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK: u32 = 0; pub const VIRTIO_SCSI_T_TMF_ABORT_TASK_SET: u32 = 1; pub const VIRTIO_SCSI_T_TMF_CLEAR_ACA: u32 = 2; pub const VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET: u32 = 3; pub const VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET: u32 = 4; pub const VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET: u32 = 5; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK: u32 = 6; pub const VIRTIO_SCSI_T_TMF_QUERY_TASK_SET: u32 = 7; pub const VIRTIO_SCSI_T_EVENTS_MISSED: u32 = 2147483648; pub const VIRTIO_SCSI_T_NO_EVENT: u32 = 0; pub const VIRTIO_SCSI_T_TRANSPORT_RESET: u32 = 1; pub const VIRTIO_SCSI_T_ASYNC_NOTIFY: u32 = 2; pub const VIRTIO_SCSI_T_PARAM_CHANGE: u32 = 3; pub const VIRTIO_SCSI_EVT_RESET_HARD: u32 = 0; pub const VIRTIO_SCSI_EVT_RESET_RESCAN: u32 = 1; pub const VIRTIO_SCSI_EVT_RESET_REMOVED: u32 = 2; pub const VIRTIO_SCSI_S_SIMPLE: u32 = 0; pub const VIRTIO_SCSI_S_ORDERED: u32 = 1; pub const VIRTIO_SCSI_S_HEAD: u32 = 2; pub const VIRTIO_SCSI_S_ACA: u32 = 3; pub type __u8 = ::std::os::raw::c_uchar; pub type __u16 = ::std::os::raw::c_ushort; pub type __u32 = ::std::os::raw::c_uint; pub type __u64 = ::std::os::raw::c_ulonglong; pub type __virtio16 = __u16; pub type __virtio32 = __u32; pub type __virtio64 = __u64; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req"][::std::mem::size_of::() - 51usize]; ["Alignment of virtio_scsi_cmd_req"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req, cdb) - 19usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_req_pi { pub lun: [__u8; 8usize], pub tag: __virtio64, pub task_attr: __u8, pub prio: __u8, pub crn: __u8, pub pi_bytesout: __virtio32, pub pi_bytesin: __virtio32, pub cdb: [__u8; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_req_pi"][::std::mem::size_of::() - 59usize]; ["Alignment of virtio_scsi_cmd_req_pi"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_req_pi::lun"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, lun) - 0usize]; ["Offset of field: virtio_scsi_cmd_req_pi::tag"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, tag) - 8usize]; ["Offset of field: virtio_scsi_cmd_req_pi::task_attr"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, task_attr) - 16usize]; ["Offset of field: virtio_scsi_cmd_req_pi::prio"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, prio) - 17usize]; ["Offset of field: virtio_scsi_cmd_req_pi::crn"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, crn) - 18usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesout"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesout) - 19usize]; ["Offset of field: virtio_scsi_cmd_req_pi::pi_bytesin"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, pi_bytesin) - 23usize]; ["Offset of field: virtio_scsi_cmd_req_pi::cdb"] [::std::mem::offset_of!(virtio_scsi_cmd_req_pi, cdb) - 27usize]; }; #[repr(C, packed)] #[derive(Debug, Copy, Clone, PartialEq)] pub struct virtio_scsi_cmd_resp { pub sense_len: __virtio32, pub resid: __virtio32, pub status_qualifier: __virtio16, pub status: __u8, pub response: __u8, pub sense: [__u8; 96usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_cmd_resp"][::std::mem::size_of::() - 108usize]; ["Alignment of virtio_scsi_cmd_resp"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_cmd_resp::sense_len"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense_len) - 0usize]; ["Offset of field: virtio_scsi_cmd_resp::resid"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, resid) - 4usize]; ["Offset of field: virtio_scsi_cmd_resp::status_qualifier"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status_qualifier) - 8usize]; ["Offset of field: virtio_scsi_cmd_resp::status"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, status) - 10usize]; ["Offset of field: virtio_scsi_cmd_resp::response"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, response) - 11usize]; ["Offset of field: virtio_scsi_cmd_resp::sense"] [::std::mem::offset_of!(virtio_scsi_cmd_resp, sense) - 12usize]; }; impl Default for virtio_scsi_cmd_resp { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_req { pub type_: __virtio32, pub subtype: __virtio32, pub lun: [__u8; 8usize], pub tag: __virtio64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_req"] [::std::mem::size_of::() - 24usize]; ["Alignment of virtio_scsi_ctrl_tmf_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::subtype"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, subtype) - 4usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, lun) - 8usize]; ["Offset of field: virtio_scsi_ctrl_tmf_req::tag"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_req, tag) - 16usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_tmf_resp { pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_tmf_resp"] [::std::mem::size_of::() - 1usize]; ["Alignment of virtio_scsi_ctrl_tmf_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_tmf_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_tmf_resp, response) - 0usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_req { pub type_: __virtio32, pub lun: [__u8; 8usize], pub event_requested: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_req"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_ctrl_an_req"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_req::type_"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, type_) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_req::lun"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, lun) - 4usize]; ["Offset of field: virtio_scsi_ctrl_an_req::event_requested"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_req, event_requested) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_ctrl_an_resp { pub event_actual: __virtio32, pub response: __u8, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_ctrl_an_resp"] [::std::mem::size_of::() - 5usize]; ["Alignment of virtio_scsi_ctrl_an_resp"] [::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::event_actual"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, event_actual) - 0usize]; ["Offset of field: virtio_scsi_ctrl_an_resp::response"] [::std::mem::offset_of!(virtio_scsi_ctrl_an_resp, response) - 4usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_event { pub event: __virtio32, pub lun: [__u8; 8usize], pub reason: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_event"][::std::mem::size_of::() - 16usize]; ["Alignment of virtio_scsi_event"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_event::event"] [::std::mem::offset_of!(virtio_scsi_event, event) - 0usize]; ["Offset of field: virtio_scsi_event::lun"] [::std::mem::offset_of!(virtio_scsi_event, lun) - 4usize]; ["Offset of field: virtio_scsi_event::reason"] [::std::mem::offset_of!(virtio_scsi_event, reason) - 12usize]; }; #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct virtio_scsi_config { pub num_queues: __virtio32, pub seg_max: __virtio32, pub max_sectors: __virtio32, pub cmd_per_lun: __virtio32, pub event_info_size: __virtio32, pub sense_size: __virtio32, pub cdb_size: __virtio32, pub max_channel: __virtio16, pub max_target: __virtio16, pub max_lun: __virtio32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { ["Size of virtio_scsi_config"][::std::mem::size_of::() - 36usize]; ["Alignment of virtio_scsi_config"][::std::mem::align_of::() - 1usize]; ["Offset of field: virtio_scsi_config::num_queues"] [::std::mem::offset_of!(virtio_scsi_config, num_queues) - 0usize]; ["Offset of field: virtio_scsi_config::seg_max"] [::std::mem::offset_of!(virtio_scsi_config, seg_max) - 4usize]; ["Offset of field: virtio_scsi_config::max_sectors"] [::std::mem::offset_of!(virtio_scsi_config, max_sectors) - 8usize]; ["Offset of field: virtio_scsi_config::cmd_per_lun"] [::std::mem::offset_of!(virtio_scsi_config, cmd_per_lun) - 12usize]; ["Offset of field: virtio_scsi_config::event_info_size"] [::std::mem::offset_of!(virtio_scsi_config, event_info_size) - 16usize]; ["Offset of field: virtio_scsi_config::sense_size"] [::std::mem::offset_of!(virtio_scsi_config, sense_size) - 20usize]; ["Offset of field: virtio_scsi_config::cdb_size"] [::std::mem::offset_of!(virtio_scsi_config, cdb_size) - 24usize]; ["Offset of field: virtio_scsi_config::max_channel"] [::std::mem::offset_of!(virtio_scsi_config, max_channel) - 28usize]; ["Offset of field: virtio_scsi_config::max_target"] [::std::mem::offset_of!(virtio_scsi_config, max_target) - 30usize]; ["Offset of field: virtio_scsi_config::max_lun"] [::std::mem::offset_of!(virtio_scsi_config, max_lun) - 32usize]; }; virtio-bindings-0.2.6/src/lib.rs000064400000000000000000000166041046102023000146520ustar 00000000000000// Copyright 2025 Alyssa Ross // SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0 #![allow(clippy::all)] #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(clippy::undocumented_unsafe_blocks)] #[cfg_attr(target_arch = "arm", path = "bindings/arm/virtio_blk.rs")] #[cfg_attr(target_arch = "aarch64", path = "bindings/aarch64/virtio_blk.rs")] #[cfg_attr(target_arch = "hexagon", path = "bindings/hexagon/virtio_blk.rs")] #[cfg_attr( target_arch = "loongarch64", path = "bindings/loongarch64/virtio_blk.rs" )] #[cfg_attr(target_arch = "m68k", path = "bindings/m68k/virtio_blk.rs")] #[cfg_attr(target_arch = "mips", path = "bindings/mipsel/virtio_blk.rs")] #[cfg_attr(target_arch = "powerpc64", path = "bindings/powerpc64le/virtio_blk.rs")] #[cfg_attr(target_arch = "riscv64", path = "bindings/riscv64/virtio_blk.rs")] #[cfg_attr(target_arch = "s390x", path = "bindings/s390x/virtio_blk.rs")] #[cfg_attr(target_arch = "sparc64", path = "bindings/sparc64/virtio_blk.rs")] #[cfg_attr(target_arch = "x86_64", path = "bindings/x86_64/virtio_blk.rs")] pub mod virtio_blk; #[cfg_attr(target_arch = "arm", path = "bindings/arm/virtio_config.rs")] #[cfg_attr(target_arch = "aarch64", path = "bindings/aarch64/virtio_config.rs")] #[cfg_attr(target_arch = "hexagon", path = "bindings/hexagon/virtio_config.rs")] #[cfg_attr( target_arch = "loongarch64", path = "bindings/loongarch64/virtio_config.rs" )] #[cfg_attr(target_arch = "m68k", path = "bindings/m68k/virtio_config.rs")] #[cfg_attr(target_arch = "mips", path = "bindings/mipsel/virtio_config.rs")] #[cfg_attr( target_arch = "powerpc64", path = "bindings/powerpc64le/virtio_config.rs" )] #[cfg_attr(target_arch = "riscv64", path = "bindings/riscv64/virtio_config.rs")] #[cfg_attr(target_arch = "s390x", path = "bindings/s390x/virtio_config.rs")] #[cfg_attr(target_arch = "sparc64", path = "bindings/sparc64/virtio_config.rs")] #[cfg_attr(target_arch = "x86_64", path = "bindings/x86_64/virtio_config.rs")] pub mod virtio_config; #[cfg_attr(target_arch = "arm", path = "bindings/arm/virtio_gpu.rs")] #[cfg_attr(target_arch = "aarch64", path = "bindings/aarch64/virtio_gpu.rs")] #[cfg_attr(target_arch = "hexagon", path = "bindings/hexagon/virtio_gpu.rs")] #[cfg_attr( target_arch = "loongarch64", path = "bindings/loongarch64/virtio_gpu.rs" )] #[cfg_attr(target_arch = "m68k", path = "bindings/m68k/virtio_gpu.rs")] #[cfg_attr(target_arch = "mips", path = "bindings/mipsel/virtio_gpu.rs")] #[cfg_attr(target_arch = "powerpc64", path = "bindings/powerpc64le/virtio_gpu.rs")] #[cfg_attr(target_arch = "riscv64", path = "bindings/riscv64/virtio_gpu.rs")] #[cfg_attr(target_arch = "s390x", path = "bindings/s390x/virtio_gpu.rs")] #[cfg_attr(target_arch = "sparc64", path = "bindings/sparc64/virtio_gpu.rs")] #[cfg_attr(target_arch = "x86_64", path = "bindings/x86_64/virtio_gpu.rs")] pub mod virtio_gpu; #[cfg_attr(target_arch = "arm", path = "bindings/arm/virtio_ids.rs")] #[cfg_attr(target_arch = "aarch64", path = "bindings/aarch64/virtio_ids.rs")] #[cfg_attr(target_arch = "hexagon", path = "bindings/hexagon/virtio_ids.rs")] #[cfg_attr( target_arch = "loongarch64", path = "bindings/loongarch64/virtio_ids.rs" )] #[cfg_attr(target_arch = "m68k", path = "bindings/m68k/virtio_ids.rs")] #[cfg_attr(target_arch = "mips", path = "bindings/mipsel/virtio_ids.rs")] #[cfg_attr(target_arch = "powerpc64", path = "bindings/powerpc64le/virtio_ids.rs")] #[cfg_attr(target_arch = "riscv64", path = "bindings/riscv64/virtio_ids.rs")] #[cfg_attr(target_arch = "s390x", path = "bindings/s390x/virtio_ids.rs")] #[cfg_attr(target_arch = "sparc64", path = "bindings/sparc64/virtio_ids.rs")] #[cfg_attr(target_arch = "x86_64", path = "bindings/x86_64/virtio_ids.rs")] pub mod virtio_ids; #[cfg_attr(target_arch = "arm", path = "bindings/arm/virtio_input.rs")] #[cfg_attr(target_arch = "aarch64", path = "bindings/aarch64/virtio_input.rs")] #[cfg_attr(target_arch = "hexagon", path = "bindings/hexagon/virtio_input.rs")] #[cfg_attr( target_arch = "loongarch64", path = "bindings/loongarch64/virtio_input.rs" )] #[cfg_attr(target_arch = "m68k", path = "bindings/m68k/virtio_input.rs")] #[cfg_attr(target_arch = "mips", path = "bindings/mipsel/virtio_input.rs")] #[cfg_attr( target_arch = "powerpc64", path = "bindings/powerpc64le/virtio_input.rs" )] #[cfg_attr(target_arch = "riscv64", path = "bindings/riscv64/virtio_input.rs")] #[cfg_attr(target_arch = "s390x", path = "bindings/s390x/virtio_input.rs")] #[cfg_attr(target_arch = "sparc64", path = "bindings/sparc64/virtio_input.rs")] #[cfg_attr(target_arch = "x86_64", path = "bindings/x86_64/virtio_input.rs")] pub mod virtio_input; #[cfg_attr(target_arch = "arm", path = "bindings/arm/virtio_mmio.rs")] #[cfg_attr(target_arch = "aarch64", path = "bindings/aarch64/virtio_mmio.rs")] #[cfg_attr(target_arch = "hexagon", path = "bindings/hexagon/virtio_mmio.rs")] #[cfg_attr( target_arch = "loongarch64", path = "bindings/loongarch64/virtio_mmio.rs" )] #[cfg_attr(target_arch = "m68k", path = "bindings/m68k/virtio_mmio.rs")] #[cfg_attr(target_arch = "mips", path = "bindings/mipsel/virtio_mmio.rs")] #[cfg_attr( target_arch = "powerpc64", path = "bindings/powerpc64le/virtio_mmio.rs" )] #[cfg_attr(target_arch = "riscv64", path = "bindings/riscv64/virtio_mmio.rs")] #[cfg_attr(target_arch = "s390x", path = "bindings/s390x/virtio_mmio.rs")] #[cfg_attr(target_arch = "sparc64", path = "bindings/sparc64/virtio_mmio.rs")] #[cfg_attr(target_arch = "x86_64", path = "bindings/x86_64/virtio_mmio.rs")] pub mod virtio_mmio; pub mod virtio_net; #[cfg_attr(target_arch = "arm", path = "bindings/arm/virtio_ring.rs")] #[cfg_attr(target_arch = "aarch64", path = "bindings/aarch64/virtio_ring.rs")] #[cfg_attr(target_arch = "hexagon", path = "bindings/hexagon/virtio_ring.rs")] #[cfg_attr( target_arch = "loongarch64", path = "bindings/loongarch64/virtio_ring.rs" )] #[cfg_attr(target_arch = "m68k", path = "bindings/m68k/virtio_ring.rs")] #[cfg_attr(target_arch = "mips", path = "bindings/mipsel/virtio_ring.rs")] #[cfg_attr( target_arch = "powerpc64", path = "bindings/powerpc64le/virtio_ring.rs" )] #[cfg_attr(target_arch = "riscv64", path = "bindings/riscv64/virtio_ring.rs")] #[cfg_attr(target_arch = "s390x", path = "bindings/s390x/virtio_ring.rs")] #[cfg_attr(target_arch = "sparc64", path = "bindings/sparc64/virtio_ring.rs")] #[cfg_attr(target_arch = "x86_64", path = "bindings/x86_64/virtio_ring.rs")] pub mod virtio_ring; #[cfg_attr(target_arch = "arm", path = "bindings/arm/virtio_scsi.rs")] #[cfg_attr(target_arch = "aarch64", path = "bindings/aarch64/virtio_scsi.rs")] #[cfg_attr(target_arch = "hexagon", path = "bindings/hexagon/virtio_scsi.rs")] #[cfg_attr( target_arch = "loongarch64", path = "bindings/loongarch64/virtio_scsi.rs" )] #[cfg_attr(target_arch = "m68k", path = "bindings/m68k/virtio_scsi.rs")] #[cfg_attr(target_arch = "mips", path = "bindings/mipsel/virtio_scsi.rs")] #[cfg_attr( target_arch = "powerpc64", path = "bindings/powerpc64le/virtio_scsi.rs" )] #[cfg_attr(target_arch = "riscv64", path = "bindings/riscv64/virtio_scsi.rs")] #[cfg_attr(target_arch = "s390x", path = "bindings/s390x/virtio_scsi.rs")] #[cfg_attr(target_arch = "sparc64", path = "bindings/sparc64/virtio_scsi.rs")] #[cfg_attr(target_arch = "x86_64", path = "bindings/x86_64/virtio_scsi.rs")] pub mod virtio_scsi; pub mod bindings { pub use super::{virtio_blk, virtio_config, virtio_mmio, virtio_net, virtio_ring, virtio_scsi}; } virtio-bindings-0.2.6/src/virtio_net/mod.rs000064400000000000000000000063511046102023000170430ustar 00000000000000// Copyright 2022 Unikie // SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0 #[cfg_attr(target_arch = "arm", path = "../bindings/arm/virtio_net.rs")] #[cfg_attr(target_arch = "aarch64", path = "../bindings/aarch64/virtio_net.rs")] #[cfg_attr(target_arch = "hexagon", path = "../bindings/hexagon/virtio_net.rs")] #[cfg_attr( target_arch = "loongarch64", path = "../bindings/loongarch64/virtio_net.rs" )] #[cfg_attr(target_arch = "m68k", path = "../bindings/m68k/virtio_net.rs")] #[cfg_attr(target_arch = "mips", path = "../bindings/mipsel/virtio_net.rs")] #[cfg_attr( target_arch = "powerpc64", path = "../bindings/powerpc64le/virtio_net.rs" )] #[cfg_attr(target_arch = "riscv64", path = "../bindings/riscv64/virtio_net.rs")] #[cfg_attr(target_arch = "s390x", path = "../bindings/s390x/virtio_net.rs")] #[cfg_attr(target_arch = "sparc64", path = "../bindings/sparc64/virtio_net.rs")] #[cfg_attr(target_arch = "x86_64", path = "../bindings/x86_64/virtio_net.rs")] mod generated; pub use generated::*; use std::fmt::{Debug, Formatter, Result}; use std::mem::{size_of, transmute}; impl Debug for virtio_net_hdr_v1 { fn fmt(&self, f: &mut Formatter) -> Result { // SAFETY: As of Linux v6.0, all union fields have compatible types. // This means that it is safe to convert any variant into any other, // as they all have the same size, alignment, and permitted values. // https://doc.rust-lang.org/reference/items/unions.html#reading-and-writing-union-fields let csum = unsafe { self.__bindgen_anon_1.csum }; // We forgo determining the correct name of the fields in the // union due to the complexity that would involve. f.debug_struct("virtio_net_hdr_v1") .field("flags", &self.flags) .field("gso_type", &self.gso_type) .field("hdr_len", &self.hdr_len) .field("gso_size", &self.gso_size) .field("csum_start", &csum.start) .field("csum_offset", &csum.offset) .field("num_buffers", &self.num_buffers) .finish() } } impl PartialEq for virtio_net_hdr_v1 { fn eq<'a>(&'a self, other: &'a Self) -> bool { // SAFETY: The values will be valid byte arrays, and the lifetimes match the // original types. unsafe { let ptr1 = transmute::<&'a Self, &'a [u8; size_of::()]>(&self); let ptr2 = transmute::<&'a Self, &'a [u8; size_of::()]>(&other); ptr1 == ptr2 } } } #[test] fn virtio_net_hdr_v1_default_debug() { assert_eq!(format!("{:?}", virtio_net_hdr_v1::default()), "virtio_net_hdr_v1 { flags: 0, gso_type: 0, hdr_len: 0, gso_size: 0, csum_start: 0, csum_offset: 0, num_buffers: 0 }"); } #[test] fn virtio_net_hdr_v1_hex_debug() { let expected = "virtio_net_hdr_v1 { flags: 0x0, gso_type: 0x0, hdr_len: 0x0, gso_size: 0x0, csum_start: 0x0, csum_offset: 0x0, num_buffers: 0x0, }"; assert_eq!(format!("{:#x?}", virtio_net_hdr_v1::default()), expected); } #[test] fn virtio_net_hdr_v1_partial_eq() { let hdr1 = virtio_net_hdr_v1::default(); let hdr2 = virtio_net_hdr_v1 { flags: 1, ..Default::default() }; assert_eq!(hdr1, hdr1); assert_ne!(hdr1, hdr2); }