mbgtools-lx
4.2.8
|
Macros | |
#define | _io_chk_cond(_cond) |
Check if a condition is true. More... | |
#define | _io_read_var(_pddev, _cmd, _fld, _pout) |
Read a standard data structure from a device. More... | |
#define | _io_write_var(_pddev, _cmd, _fld, _pin) |
Write a standard data structure to a device. More... | |
#define | _io_write_cmd(_pddev, _cmd) |
Write a command byte to the device. More... | |
#define | _io_read_gps(_pddev, _cmd, _fld, _pout, _size) |
Write a large data structure with variable size to a device. More... | |
#define | _io_read_gps_var(_pddev, _cmd, _fld, _pout) |
Read a large data structure with fixed size from a device. More... | |
#define | _io_write_gps_var(_pddev, _cmd, _fld, _pin) |
Write a large data structure with fixed size to a device. More... | |
General functions that read a data structure from a device into a buffer, check the return code and, if no error occurred, copy the data up to user space, or copy data from user space to a buffer and write the buffer to the device.
If device access fails, goto a label which handles the error.
Since USB devices on Linux require a DMA-capable I/O buffer we use a common buffer which is part of the device's private data. Since this buffer is shared between processes the code which copies the data from or to user space has to be protected by the device semaphore in the same way as the actual device access.
#define _io_chk_cond | ( | _cond | ) |
Check if a condition is true.
If condition is false then goto an error label.
Definition at line 444 of file macioctl.h.
Referenced by ioctl_switch().
#define _io_read_gps | ( | _pddev, | |
_cmd, | |||
_fld, | |||
_pout, | |||
_size | |||
) |
Write a large data structure with variable size to a device.
First check if the device supports large (GPS) data structures.
If access fails goto an error label.
Definition at line 526 of file macioctl.h.
#define _io_read_gps_var | ( | _pddev, | |
_cmd, | |||
_fld, | |||
_pout | |||
) |
Read a large data structure with fixed size from a device.
First check if the device supports large (GPS) data structures.
If access fails goto an error label.
Definition at line 554 of file macioctl.h.
Referenced by ioctl_switch().
#define _io_read_var | ( | _pddev, | |
_cmd, | |||
_fld, | |||
_pout | |||
) |
Read a standard data structure from a device.
If access fails goto an error label.
Definition at line 459 of file macioctl.h.
Referenced by ioctl_switch().
#define _io_write_cmd | ( | _pddev, | |
_cmd | |||
) |
Write a command byte to the device.
If access fails goto an error label.
We don't have a buffer here that needs to be protected.
Definition at line 505 of file macioctl.h.
#define _io_write_gps_var | ( | _pddev, | |
_cmd, | |||
_fld, | |||
_pin | |||
) |
Write a large data structure with fixed size to a device.
First check if the device supports large (GPS) data structures.
If access fails goto an error label.
Definition at line 582 of file macioctl.h.
Referenced by ioctl_switch().
#define _io_write_var | ( | _pddev, | |
_cmd, | |||
_fld, | |||
_pin | |||
) |
Write a standard data structure to a device.
If access fails goto an error label.
Definition at line 483 of file macioctl.h.
Referenced by ioctl_switch().