33 #include <sys/ioctl.h>
54 ret = ioctl(dev->
fd, cmd, arg);
73 ssize_t read_size = 0;
77 ioctl_arg.
size = size;
78 ioctl_arg.
data = rdata;
113 ssize_t write_size = 0;
116 ioctl_arg.
offset = offset;
117 ioctl_arg.
size = size;
118 ioctl_arg.
data = wdata;
134 if(write_size == -1) {
153 ioctl_arg.
offset = offset;
175 *((uint8_t*)rdata) = ioctl_arg.
value;
191 ioctl_arg.
offset = offset;
193 ioctl_arg.
value = *((uint8_t*)wdata);
Data structures for flink devices and subdevices.
uint8_t bit
Offset of byte containing the single bit, taken from subdevice base address.
ssize_t flink_write(flink_subdev *subdev, uint32_t offset, uint8_t size, void *wdata)
Write to a flink subdevice.
uint32_t offset
subdevice to read from / write to
uint8_t value
Bit number in byte.
uint8_t subdevice
Value of the bit.
uint8_t size
offset to base address of subdevice
flink_dev * parent
Unique id, must be unique for a certain subdevice.
flink userspace library, ioctl definitions.
int flink_read_bit(flink_subdev *subdev, uint32_t offset, uint8_t bit, void *rdata)
Read a single bit from a flink subdevice.
int flink_ioctl(flink_dev *dev, int cmd, void *arg)
IOCTL operation for a flink device.
int validate_flink_subdev(flink_subdev *subdev)
Checks if flink subdevice belongs to the device.
Contains validation functions for flink.
ssize_t flink_read(flink_subdev *subdev, uint32_t offset, uint8_t size, void *rdata)
Read from a flink subdevice.
int validate_flink_dev(flink_dev *dev)
Checks if flink device was opened.
int flink_write_bit(flink_subdev *subdev, uint32_t offset, uint8_t bit, void *wdata)
Write a single bit to a flink subdevice.
#define dbg_print(fmt,...)