In general, _IOR() and _IOW() take 3 parameters and make a
number out of them. That number is used in a driver's ioctl
function to decide what the request is, its direction (in or out),
its data type, and data size.
For example, on x86, _IOR and _IOW make a 32-bit number, used as:
|dd|ssssssssssssss|tttttttt|nnnnnnnn|
| \-size \-type \-number
\-direction
Size is limited to 14 bits; Direction is Read, Write, or None.
Type is usually (meant to be) a constant for any one driver,
such as 'T' for ttys, 'S' for SCSI, 'M' for MTRR driver,
'A' for APM, 'a' for ATM, 0x93 for autofs, 'C' for CAPI,
'B' for CCISS, 's' for cdk, 'c' for coda, 'd' for devfsd,
0x89 for DECNET, 'f' and 'v' for ext2/3, 'F' for frame buffer,
2 for floppy driver, 0x12 for block layer, 'H' for HID driver,
Is there a registry of IOCTL magic numbers? Yep, see
linux/Documentation/ioctl-number.txt for more info and numbers.
See linux/include/asm-i386/ioctl.h for macro specifics.
-- ~Randy - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/