mbgtools-lx  4.2.8
IOCTL_GENERIC_REQ Struct Reference

A structure used to pass generic IOCTL requests to the kernel driver. More...

#include <mbgioctl.h>

Data Fields

uint64_t in_p
 Address of the input buffer. More...
 
uint64_t out_p
 Address of the output buffer. More...
 
uint32_t in_sz
 Size of the input buffer. More...
 
uint32_t out_sz
 Size of the output buffer. More...
 
uint32_t info
 E.g. cmd code for the device. More...
 
uint32_t reserved
 Reserved, yet not used. More...
 

Detailed Description

A structure used to pass generic IOCTL requests to the kernel driver.

In a mixed 32/64 bit environment we may have 32 bit pointers in user space but 64 bit pointers in kernel space, so if we defined buffer addresses as usual pointers, and buffer sizes as size_t the memory layout of this structure would be different in 32 bit and 64 bit builds, so we use only fixed-size types to avoid this and make sure the structure has always the same size.

Note
Pointers should generally be cast to 'uintptr_t' before being copied into the 64 bit address fields. This makes sure 32 bit pointers are expanded to 64 bit in an unsigned way, i.e. with the extended bytes always set to 0x00. Without this cast a pointer might be extended with 0xFF if the MSB of the original 32 bit pointer is set, which would result in an incompatible 64 bit address in kernel space. In an environment where pointers have 64 bit anyway an 'uintptr_t' cast wouldn't be required, but it doesn't hurt, either.

Definition at line 417 of file mbgioctl.h.

Field Documentation

◆ in_p

uint64_t IOCTL_GENERIC_REQ::in_p

Address of the input buffer.

Definition at line 419 of file mbgioctl.h.

Referenced by ioctl_switch().

◆ in_sz

uint32_t IOCTL_GENERIC_REQ::in_sz

Size of the input buffer.

Definition at line 421 of file mbgioctl.h.

Referenced by ioctl_switch().

◆ info

uint32_t IOCTL_GENERIC_REQ::info

E.g. cmd code for the device.

Definition at line 423 of file mbgioctl.h.

Referenced by ioctl_switch().

◆ out_p

uint64_t IOCTL_GENERIC_REQ::out_p

Address of the output buffer.

Definition at line 420 of file mbgioctl.h.

Referenced by ioctl_switch().

◆ out_sz

uint32_t IOCTL_GENERIC_REQ::out_sz

Size of the output buffer.

Definition at line 422 of file mbgioctl.h.

Referenced by ioctl_switch().

◆ reserved

uint32_t IOCTL_GENERIC_REQ::reserved

Reserved, yet not used.

Definition at line 424 of file mbgioctl.h.


The documentation for this struct was generated from the following file: