Module opcode

Source
Expand description

Const functions for computing opcode values.

Linux’s headers define macros such as _IO, _IOR, _IOW, and _IOWR for defining ioctl values in a structured way that encode whether they are reading and/or writing, and other information about the ioctl. The functions in this module correspond to those macros.

If you’re writing a driver and defining your own ioctl numbers, it’s recommended to use these functions to compute them.

Functions§

from_components
Create a new opcode from a direction, group, number, and size.
none
Create a new opcode from a group, a number, that uses no data.
read
Create a new reading opcode from a group, a number and the type of data.
read_write
Create a new reading and writing opcode from a group, a number and the type of data.
write
Create a new writing opcode from a group, a number and the type of data.