diff --git a/Cargo.toml b/Cargo.toml index 3f8079a1..f5265157 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ static_assertions = "1.1.0" libc = "0.2.100" [package.metadata.docs.rs] -features = ["default", "ioctl", "netlink", "io_uring", "if_arp", "if_ether", "if_packet", "net", "prctl", "elf", "xdp", "mempolicy", "system"] +features = ["default", "ioctl", "netlink", "io_uring", "if_arp", "if_ether", "if_packet", "net", "prctl", "elf", "xdp", "mempolicy", "system", "mtd"] targets = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"] # The rest of this file is auto-generated! @@ -34,6 +34,7 @@ if_packet = [] io_uring = [] ioctl = [] mempolicy = [] +mtd = [] net = [] netlink = [] prctl = [] diff --git a/gen/modules/mtd.h b/gen/modules/mtd.h new file mode 100644 index 00000000..42fcd33a --- /dev/null +++ b/gen/modules/mtd.h @@ -0,0 +1,9 @@ +// This file includes selected Linux header files. + +#include "support.h" + +// Selected Linux headers. + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) +#include +#endif diff --git a/src/aarch64/mtd.rs b/src/aarch64/mtd.rs new file mode 100644 index 00000000..030bd5ad --- /dev/null +++ b/src/aarch64/mtd.rs @@ -0,0 +1,218 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/arm/mtd.rs b/src/arm/mtd.rs new file mode 100644 index 00000000..79c48fe2 --- /dev/null +++ b/src/arm/mtd.rs @@ -0,0 +1,216 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/csky/mtd.rs b/src/csky/mtd.rs new file mode 100644 index 00000000..d50d2122 --- /dev/null +++ b/src/csky/mtd.rs @@ -0,0 +1,216 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/lib.rs b/src/lib.rs index 4edfaf35..24384972 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -239,6 +239,10 @@ pub mod ioctl; #[cfg(target_arch = "arm")] #[path = "arm/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "arm")] +#[path = "arm/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "arm")] #[path = "arm/net.rs"] @@ -291,6 +295,10 @@ pub mod ioctl; #[cfg(target_arch = "aarch64")] #[path = "aarch64/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "aarch64")] +#[path = "aarch64/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "aarch64")] #[path = "aarch64/net.rs"] @@ -343,6 +351,10 @@ pub mod ioctl; #[cfg(target_arch = "csky")] #[path = "csky/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "csky")] +#[path = "csky/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "csky")] #[path = "csky/net.rs"] @@ -395,6 +407,10 @@ pub mod ioctl; #[cfg(target_arch = "loongarch64")] #[path = "loongarch64/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "loongarch64")] +#[path = "loongarch64/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "loongarch64")] #[path = "loongarch64/net.rs"] @@ -447,6 +463,10 @@ pub mod ioctl; #[cfg(target_arch = "mips")] #[path = "mips/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "mips")] +#[path = "mips/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "mips")] #[path = "mips/net.rs"] @@ -499,6 +519,10 @@ pub mod ioctl; #[cfg(target_arch = "mips64")] #[path = "mips64/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "mips64")] +#[path = "mips64/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "mips64")] #[path = "mips64/net.rs"] @@ -551,6 +575,10 @@ pub mod ioctl; #[cfg(target_arch = "mips32r6")] #[path = "mips32r6/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "mips32r6")] +#[path = "mips32r6/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "mips32r6")] #[path = "mips32r6/net.rs"] @@ -603,6 +631,10 @@ pub mod ioctl; #[cfg(target_arch = "mips64r6")] #[path = "mips64r6/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "mips64r6")] +#[path = "mips64r6/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "mips64r6")] #[path = "mips64r6/net.rs"] @@ -655,6 +687,10 @@ pub mod ioctl; #[cfg(target_arch = "powerpc")] #[path = "powerpc/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "powerpc")] +#[path = "powerpc/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "powerpc")] #[path = "powerpc/net.rs"] @@ -707,6 +743,10 @@ pub mod ioctl; #[cfg(target_arch = "powerpc64")] #[path = "powerpc64/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "powerpc64")] +#[path = "powerpc64/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "powerpc64")] #[path = "powerpc64/net.rs"] @@ -759,6 +799,10 @@ pub mod ioctl; #[cfg(target_arch = "riscv32")] #[path = "riscv32/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "riscv32")] +#[path = "riscv32/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "riscv32")] #[path = "riscv32/net.rs"] @@ -811,6 +855,10 @@ pub mod ioctl; #[cfg(target_arch = "riscv64")] #[path = "riscv64/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "riscv64")] +#[path = "riscv64/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "riscv64")] #[path = "riscv64/net.rs"] @@ -863,6 +911,10 @@ pub mod ioctl; #[cfg(target_arch = "s390x")] #[path = "s390x/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "s390x")] +#[path = "s390x/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "s390x")] #[path = "s390x/net.rs"] @@ -915,6 +967,10 @@ pub mod ioctl; #[cfg(target_arch = "sparc")] #[path = "sparc/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "sparc")] +#[path = "sparc/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "sparc")] #[path = "sparc/net.rs"] @@ -967,6 +1023,10 @@ pub mod ioctl; #[cfg(target_arch = "sparc64")] #[path = "sparc64/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "sparc64")] +#[path = "sparc64/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "sparc64")] #[path = "sparc64/net.rs"] @@ -1019,6 +1079,10 @@ pub mod ioctl; #[cfg(target_arch = "x86")] #[path = "x86/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(target_arch = "x86")] +#[path = "x86/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(target_arch = "x86")] #[path = "x86/net.rs"] @@ -1071,6 +1135,10 @@ pub mod ioctl; #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] #[path = "x86_64/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] +#[path = "x86_64/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] #[path = "x86_64/net.rs"] @@ -1123,6 +1191,10 @@ pub mod ioctl; #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] #[path = "x32/mempolicy.rs"] pub mod mempolicy; +#[cfg(feature = "mtd")] +#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +#[path = "x32/mtd.rs"] +pub mod mtd; #[cfg(feature = "net")] #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] #[path = "x32/net.rs"] diff --git a/src/loongarch64/mtd.rs b/src/loongarch64/mtd.rs new file mode 100644 index 00000000..0a6fc7cd --- /dev/null +++ b/src/loongarch64/mtd.rs @@ -0,0 +1,218 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/mips/mtd.rs b/src/mips/mtd.rs new file mode 100644 index 00000000..bf313194 --- /dev/null +++ b/src/mips/mtd.rs @@ -0,0 +1,226 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/mips32r6/mtd.rs b/src/mips32r6/mtd.rs new file mode 100644 index 00000000..bf313194 --- /dev/null +++ b/src/mips32r6/mtd.rs @@ -0,0 +1,226 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/mips64/mtd.rs b/src/mips64/mtd.rs new file mode 100644 index 00000000..01c2f5cc --- /dev/null +++ b/src/mips64/mtd.rs @@ -0,0 +1,228 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/mips64r6/mtd.rs b/src/mips64r6/mtd.rs new file mode 100644 index 00000000..01c2f5cc --- /dev/null +++ b/src/mips64r6/mtd.rs @@ -0,0 +1,228 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const _MIPS_ISA_MIPS1: u32 = 1; +pub const _MIPS_ISA_MIPS2: u32 = 2; +pub const _MIPS_ISA_MIPS3: u32 = 3; +pub const _MIPS_ISA_MIPS4: u32 = 4; +pub const _MIPS_ISA_MIPS5: u32 = 5; +pub const _MIPS_ISA_MIPS32: u32 = 6; +pub const _MIPS_ISA_MIPS64: u32 = 7; +pub const _MIPS_SIM_ABI32: u32 = 1; +pub const _MIPS_SIM_NABI32: u32 = 2; +pub const _MIPS_SIM_ABI64: u32 = 3; +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/powerpc/mtd.rs b/src/powerpc/mtd.rs new file mode 100644 index 00000000..5aa8f670 --- /dev/null +++ b/src/powerpc/mtd.rs @@ -0,0 +1,222 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_short; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct __vector128 { +pub u: [__u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/powerpc64/mtd.rs b/src/powerpc64/mtd.rs new file mode 100644 index 00000000..77fe08c7 --- /dev/null +++ b/src/powerpc64/mtd.rs @@ -0,0 +1,224 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_long; +pub type __u64 = crate::ctypes::c_ulong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct __vector128 { +pub u: [__u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/riscv32/mtd.rs b/src/riscv32/mtd.rs new file mode 100644 index 00000000..d50d2122 --- /dev/null +++ b/src/riscv32/mtd.rs @@ -0,0 +1,216 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/riscv64/mtd.rs b/src/riscv64/mtd.rs new file mode 100644 index 00000000..0a6fc7cd --- /dev/null +++ b/src/riscv64/mtd.rs @@ -0,0 +1,218 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/s390x/mtd.rs b/src/s390x/mtd.rs new file mode 100644 index 00000000..fc01d4fb --- /dev/null +++ b/src/s390x/mtd.rs @@ -0,0 +1,238 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type addr_t = crate::ctypes::c_ulong; +pub type saddr_t = crate::ctypes::c_long; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_size_t = crate::ctypes::c_ulong; +pub type __kernel_ssize_t = crate::ctypes::c_long; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_ino_t = crate::ctypes::c_uint; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_ptrdiff_t = crate::ctypes::c_long; +pub type __kernel_sigset_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C, packed(4))] +#[derive(Copy, Clone)] +pub struct __vector128 { +pub __bindgen_anon_1: __vector128__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __vector128__bindgen_ty_1__bindgen_ty_1 { +pub high: __u64, +pub low: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union __vector128__bindgen_ty_1 { +pub __bindgen_anon_1: __vector128__bindgen_ty_1__bindgen_ty_1, +pub u: [__u32; 4usize], +} diff --git a/src/sparc/mtd.rs b/src/sparc/mtd.rs new file mode 100644 index 00000000..43fd7902 --- /dev/null +++ b/src/sparc/mtd.rs @@ -0,0 +1,216 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_long; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_daddr_t = crate::ctypes::c_long; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/sparc64/mtd.rs b/src/sparc64/mtd.rs new file mode 100644 index 00000000..01a21179 --- /dev/null +++ b/src/sparc64/mtd.rs @@ -0,0 +1,224 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_suseconds_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_dev_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __kernel_old_timeval { +pub tv_sec: __kernel_long_t, +pub tv_usec: __kernel_suseconds_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/x32/mtd.rs b/src/x32/mtd.rs new file mode 100644 index 00000000..3fe4dba0 --- /dev/null +++ b/src/x32/mtd.rs @@ -0,0 +1,218 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_long_t = crate::ctypes::c_longlong; +pub type __kernel_ulong_t = crate::ctypes::c_ulonglong; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/x86/mtd.rs b/src/x86/mtd.rs new file mode 100644 index 00000000..79c48fe2 --- /dev/null +++ b/src/x86/mtd.rs @@ -0,0 +1,216 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_mode_t = crate::ctypes::c_ushort; +pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort; +pub type __kernel_uid_t = crate::ctypes::c_ushort; +pub type __kernel_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ushort; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_old_uid_t = __kernel_uid_t; +pub type __kernel_old_gid_t = __kernel_gid_t; +pub type __kernel_size_t = crate::ctypes::c_uint; +pub type __kernel_ssize_t = crate::ctypes::c_int; +pub type __kernel_ptrdiff_t = crate::ctypes::c_int; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +} diff --git a/src/x86_64/mtd.rs b/src/x86_64/mtd.rs new file mode 100644 index 00000000..0305e69e --- /dev/null +++ b/src/x86_64/mtd.rs @@ -0,0 +1,218 @@ +/* automatically generated by rust-bindgen 0.66.1 */ + +pub type __s8 = crate::ctypes::c_schar; +pub type __u8 = crate::ctypes::c_uchar; +pub type __s16 = crate::ctypes::c_short; +pub type __u16 = crate::ctypes::c_ushort; +pub type __s32 = crate::ctypes::c_int; +pub type __u32 = crate::ctypes::c_uint; +pub type __s64 = crate::ctypes::c_longlong; +pub type __u64 = crate::ctypes::c_ulonglong; +pub type __kernel_key_t = crate::ctypes::c_int; +pub type __kernel_mqd_t = crate::ctypes::c_int; +pub type __kernel_old_uid_t = crate::ctypes::c_ushort; +pub type __kernel_old_gid_t = crate::ctypes::c_ushort; +pub type __kernel_old_dev_t = crate::ctypes::c_ulong; +pub type __kernel_long_t = crate::ctypes::c_long; +pub type __kernel_ulong_t = crate::ctypes::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = crate::ctypes::c_uint; +pub type __kernel_pid_t = crate::ctypes::c_int; +pub type __kernel_ipc_pid_t = crate::ctypes::c_int; +pub type __kernel_uid_t = crate::ctypes::c_uint; +pub type __kernel_gid_t = crate::ctypes::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = crate::ctypes::c_int; +pub type __kernel_uid32_t = crate::ctypes::c_uint; +pub type __kernel_gid32_t = crate::ctypes::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = crate::ctypes::c_longlong; +pub type __kernel_old_time_t = __kernel_long_t; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_time64_t = crate::ctypes::c_longlong; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = crate::ctypes::c_int; +pub type __kernel_clockid_t = crate::ctypes::c_int; +pub type __kernel_caddr_t = *mut crate::ctypes::c_char; +pub type __kernel_uid16_t = crate::ctypes::c_ushort; +pub type __kernel_gid16_t = crate::ctypes::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +pub type __poll_t = crate::ctypes::c_uint; +pub type mtd_info_t = mtd_info_user; +pub type erase_info_t = erase_info_user; +pub type region_info_t = region_info_user; +pub type nand_oobinfo_t = nand_oobinfo; +pub type nand_ecclayout_t = nand_ecclayout_user; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user { +pub start: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct erase_info_user64 { +pub start: __u64, +pub length: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf { +pub start: __u32, +pub length: __u32, +pub ptr: *mut crate::ctypes::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_oob_buf64 { +pub start: __u64, +pub pad: __u32, +pub length: __u32, +pub usr_ptr: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_write_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req_ecc_stats { +pub uncorrectable_errors: __u32, +pub corrected_bitflips: __u32, +pub max_bitflips: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_read_req { +pub start: __u64, +pub len: __u64, +pub ooblen: __u64, +pub usr_data: __u64, +pub usr_oob: __u64, +pub mode: __u8, +pub padding: [__u8; 7usize], +pub ecc_stats: mtd_read_req_ecc_stats, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_info_user { +pub type_: __u8, +pub flags: __u32, +pub size: __u32, +pub erasesize: __u32, +pub writesize: __u32, +pub oobsize: __u32, +pub padding: __u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct region_info_user { +pub offset: __u32, +pub erasesize: __u32, +pub numblocks: __u32, +pub regionindex: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct otp_info { +pub start: __u32, +pub length: __u32, +pub locked: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobinfo { +pub useecc: __u32, +pub eccbytes: __u32, +pub oobfree: [[__u32; 2usize]; 8usize], +pub eccpos: [__u32; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_oobfree { +pub offset: __u32, +pub length: __u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nand_ecclayout_user { +pub eccbytes: __u32, +pub eccpos: [__u32; 64usize], +pub oobavail: __u32, +pub oobfree: [nand_oobfree; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct mtd_ecc_stats { +pub corrected: __u32, +pub failed: __u32, +pub badblocks: __u32, +pub bbtblocks: __u32, +} +pub const MTD_ABSENT: u32 = 0; +pub const MTD_RAM: u32 = 1; +pub const MTD_ROM: u32 = 2; +pub const MTD_NORFLASH: u32 = 3; +pub const MTD_NANDFLASH: u32 = 4; +pub const MTD_DATAFLASH: u32 = 6; +pub const MTD_UBIVOLUME: u32 = 7; +pub const MTD_MLCNANDFLASH: u32 = 8; +pub const MTD_WRITEABLE: u32 = 1024; +pub const MTD_BIT_WRITEABLE: u32 = 2048; +pub const MTD_NO_ERASE: u32 = 4096; +pub const MTD_POWERUP_LOCK: u32 = 8192; +pub const MTD_SLC_ON_MLC_EMULATION: u32 = 16384; +pub const MTD_CAP_ROM: u32 = 0; +pub const MTD_CAP_RAM: u32 = 7168; +pub const MTD_CAP_NORFLASH: u32 = 3072; +pub const MTD_CAP_NANDFLASH: u32 = 1024; +pub const MTD_CAP_NVRAM: u32 = 7168; +pub const MTD_NANDECC_OFF: u32 = 0; +pub const MTD_NANDECC_PLACE: u32 = 1; +pub const MTD_NANDECC_AUTOPLACE: u32 = 2; +pub const MTD_NANDECC_PLACEONLY: u32 = 3; +pub const MTD_NANDECC_AUTOPL_USR: u32 = 4; +pub const MTD_OTP_OFF: u32 = 0; +pub const MTD_OTP_FACTORY: u32 = 1; +pub const MTD_OTP_USER: u32 = 2; +pub const MTD_MAX_OOBFREE_ENTRIES: u32 = 8; +pub const MTD_MAX_ECCPOS_ENTRIES: u32 = 64; +pub const MTD_OPS_PLACE_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_PLACE_OOB; +pub const MTD_OPS_AUTO_OOB: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_AUTO_OOB; +pub const MTD_OPS_RAW: _bindgen_ty_1 = _bindgen_ty_1::MTD_OPS_RAW; +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum _bindgen_ty_1 { +MTD_OPS_PLACE_OOB = 0, +MTD_OPS_AUTO_OOB = 1, +MTD_OPS_RAW = 2, +} +#[repr(u32)] +#[non_exhaustive] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum mtd_file_modes { +MTD_FILE_MODE_NORMAL = 0, +MTD_FILE_MODE_OTP_FACTORY = 1, +MTD_FILE_MODE_OTP_USER = 2, +MTD_FILE_MODE_RAW = 3, +}