From 9f528bbcc8a3d94c9be27a0eecc12022d4b3bfaa Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Fri, 1 Feb 2019 01:08:17 +0100 Subject: sys/linux: rename dev descriptions files Prefix file names of descriptions of /dev/* files with dev_. And give some of them more appropriate names. --- sys/linux/dev_i2c.txt | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sys/linux/dev_i2c.txt (limited to 'sys/linux/dev_i2c.txt') diff --git a/sys/linux/dev_i2c.txt b/sys/linux/dev_i2c.txt new file mode 100644 index 000000000..cf7d657f5 --- /dev/null +++ b/sys/linux/dev_i2c.txt @@ -0,0 +1,49 @@ +# Copyright 2018 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +include +include + +define I2C_MAX_BLOCK (I2C_SMBUS_BLOCK_MAX + 2) + +resource fd_i2c[fd] + +syz_open_dev$I2C(dev ptr[in, string["/dev/i2c-#"]], id intptr, flags flags[open_flags]) fd_i2c + +ioctl$I2C_RETRIES(fd fd_i2c, cmd const[I2C_RETRIES], arg intptr) +ioctl$I2C_TIMEOUT(fd fd_i2c, cmd const[I2C_TIMEOUT], arg intptr) +ioctl$I2C_SLAVE(fd fd_i2c, cmd const[I2C_SLAVE], arg intptr[0:0x3ff]) +ioctl$I2C_SLAVE_FORCE(fd fd_i2c, cmd const[I2C_SLAVE_FORCE], arg intptr[0:0x3ff]) +ioctl$I2C_TENBIT(fd fd_i2c, cmd const[I2C_TENBIT], arg boolptr) +ioctl$I2C_PEC(fd fd_i2c, cmd const[I2C_PEC], arg intptr) + +ioctl$I2C_FUNCS(fd fd_i2c, cmd const[I2C_FUNCS], arg ptr[in, intptr]) +ioctl$I2C_RDWR(fd fd_i2c, cmd const[I2C_RDWR], arg ptr[in, i2c_rdwr_ioctl_data]) +ioctl$I2C_SMBUS(fd fd_i2c, cmd const[I2C_SMBUS], arg ptr[in, i2c_smbus_ioctl_data]) + +i2c_smbus_ioctl_data { + read_write bool8 + command int8 + size int32[I2C_SMBUS_QUICK:I2C_SMBUS_I2C_BLOCK_DATA] + data ptr[in, i2c_smbus_data] +} + +i2c_smbus_data [ + byte int8 + word int16 + block array[int8, I2C_MAX_BLOCK] +] + +i2c_rdwr_ioctl_data { + msgs ptr[in, array[i2c_msg]] + nmsgs len[msgs, int32] +} + +i2c_msg { + addr int16 + flags flags[i2c_msg_flags, int16] + len len[buf, int16] + buf ptr[in, array[int8]] +} + +i2c_msg_flags = I2C_M_RD, I2C_M_TEN, I2C_M_DMA_SAFE, I2C_M_RECV_LEN, I2C_M_NO_RD_ACK, I2C_M_IGNORE_NAK, I2C_M_REV_DIR_ADDR, I2C_M_NOSTART, I2C_M_STOP -- cgit mrf-deployment