Documentation ¶
Overview ¶
Package mtdabi is a Golang implementation of helper functions for the `ioctl` calls in the Linux MTD ABI found at https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/mtd/mtd-abi.h.
This package is currently based on version `v5.12` of the Linux kernel.
Index ¶
- func EccGetLayout(fd uintptr, value *unix.NandEcclayout) error
- func EccGetStats(fd uintptr, value *unix.MtdEccStats) error
- func MemErase(fd uintptr, value *unix.EraseInfo) error
- func MemErase64(fd uintptr, value *unix.EraseInfo64) error
- func MemGetBadBlock(fd uintptr, value *int64) error
- func MemGetInfo(fd uintptr, value *unix.MtdInfo) error
- func MemGetOobSel(fd uintptr, value *unix.NandOobinfo) error
- func MemGetRegionCount(fd uintptr, value *int32) error
- func MemGetRegionInfo(fd uintptr, value *unix.RegionInfo) error
- func MemIsLocked(fd uintptr, value *unix.EraseInfo) error
- func MemLock(fd uintptr, value *unix.EraseInfo) error
- func MemReadOob(fd uintptr, value *unix.MtdOobBuf) error
- func MemReadOob64(fd uintptr, value *unix.MtdOobBuf64) error
- func MemSetBadBlock(fd uintptr, value *int64) error
- func MemUnlock(fd uintptr, value *unix.EraseInfo) error
- func MemWrite(fd uintptr, value *unix.MtdWriteReq) error
- func MemWriteOob(fd uintptr, value *unix.MtdOobBuf) error
- func MemWriteOob64(fd uintptr, value *unix.MtdOobBuf64) error
- func MtdFileMode(fd, value uintptr) error
- func OtpGetRegionCount(fd uintptr, value *int32) error
- func OtpGetRegionInfo(fd uintptr, value *unix.OtpInfo) error
- func OtpLock(fd uintptr, value *unix.OtpInfo) error
- func OtpSelect(fd uintptr, value *int32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EccGetLayout ¶
func EccGetLayout(fd uintptr, value *unix.NandEcclayout) error
EccGetLayout gets ECC layout (deprecated)
#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user)
func EccGetStats ¶
func EccGetStats(fd uintptr, value *unix.MtdEccStats) error
EccGetStats gets statistics about corrected/uncorrected errors
#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
func MemErase ¶
MemErase erases segment of MTD
#define MEMERASE _IOW('M', 2, struct erase_info_user)
func MemErase64 ¶
func MemErase64(fd uintptr, value *unix.EraseInfo64) error
MemErase64 erases segment of MTD (supports 64-bit address)
#define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
func MemGetBadBlock ¶
MemGetBadBlock checks if an eraseblock is bad
#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t)
func MemGetInfo ¶
MemGetInfo gets MTD characteristics info (better to use sysfs)
#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
func MemGetOobSel ¶
func MemGetOobSel(fd uintptr, value *unix.NandOobinfo) error
MemGetOobSel gets info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface
#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
func MemGetRegionCount ¶
MemGetRegionCount gets the number of different erase regions
#define MEMGETREGIONCOUNT _IOR('M', 7, int)
func MemGetRegionInfo ¶
func MemGetRegionInfo(fd uintptr, value *unix.RegionInfo) error
MemGetRegionInfo gets information about the erase region for a specific index
#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
func MemIsLocked ¶
MemIsLocked checks if chip is locked (for MTD that supports it)
#define MEMISLOCKED _IOR('M', 23, struct erase_info_user)
func MemLock ¶
MemLock locks a chip (for MTD that supports it)
#define MEMLOCK _IOW('M', 5, struct erase_info_user)
func MemReadOob ¶
MemReadOob reads out-of-band data from MTD
#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
func MemReadOob64 ¶
func MemReadOob64(fd uintptr, value *unix.MtdOobBuf64) error
MemReadOob64 reads data from OOB (64-bit version)
#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64)
func MemSetBadBlock ¶
MemSetBadBlock marks an eraseblock as bad
#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t)
func MemUnlock ¶
MemUnlock unlocks a chip (for MTD that supports it)
#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
func MemWrite ¶
func MemWrite(fd uintptr, value *unix.MtdWriteReq) error
MemWrite is the most generic write interface; can write in-band and/or out-of-band in various modes (see "struct mtd_write_req"). This ioctl is not supported for flashes without OOB, e.g., NOR flash.
#define MEMWRITE _IOWR('M', 24, struct mtd_write_req)
func MemWriteOob ¶
MemWriteOob writes out-of-band data from MTD
#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
func MemWriteOob64 ¶
func MemWriteOob64(fd uintptr, value *unix.MtdOobBuf64) error
MemWriteOob64 writes data to OOB (64-bit version)
#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
func MtdFileMode ¶
MtdFileMode sets MTD mode on a per-file-descriptor basis (see "MTD file modes")
#define MTDFILEMODE _IO('M', 19)
func OtpGetRegionCount ¶
OtpGetRegionCount gets number of OTP (One-Time Programmable) regions
#define OTPGETREGIONCOUNT _IOW('M', 14, int)
func OtpGetRegionInfo ¶
OtpGetRegionInfo gets all OTP (One-Time Programmable) info about MTD
#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
Types ¶
This section is empty.