Linux
fields
IOC_NRBITS 8 IOC_TYPEBITS 8 IOC_SIZEBITS 14 IOC_DIRBITS 2
IOC_NRSHIFT 0 IOC_TYPESHIFT IOC_NRSHIFT+IOC_NRBITS = 8 IOC_SIZESHIFT IOC_TYPESHIFT + IOC_TYPESIZE = 16 IOC_DIRSHIFT IOC_SIZESHIFT + IOC_SIZEBITS = 30
DIR (2) | SIZE(14) | TYPE(8) | NR(8)
IOC(dir, type, nr, size) dir << dirshift | type << typeshift | nr << nrshift | size << sizeshift
direction
IOC_NONE 0 IOC_WRITE 1 IOC_READ 2
example
0x8b01 type=8b(wireless) nr=01