mbgtools-lx
4.2.8
|
#include <mbg_tgt.h>
#include <cfg_hlp.h>
#include <mbgerror.h>
#include <mbggeo.h>
#include <pcpsdev.h>
#include <pci_asic.h>
#include <pcpsiobf.h>
#include <linux/ioctl.h>
Go to the source code of this file.
Data Structures | |
struct | IOCTL_GENERIC_REQ |
A structure used to pass generic IOCTL requests to the kernel driver. More... | |
struct | IOCTL_DEV_FEAT_REQ |
Request buffer used to query a device feature. More... | |
union | IOCTL_BUFFER |
Enumerations | |
enum | MBG_REQ_PRIVL { MBG_REQ_PRIVL_NONE, MBG_REQ_PRIVL_EXT_STATUS, MBG_REQ_PRIVL_CFG_READ, MBG_REQ_PRIVL_CFG_WRITE, MBG_REQ_PRIVL_SYSTEM, N_MBG_REQ_PRIVL } |
Privilege levels for IOCTL codes. More... | |
Functions | |
static __mbg_inline int | ioctl_get_required_privilege (ulong ioctl_code) |
Determine the privilege level required to execute a specific IOCTL command. More... | |
int | mbgioctl_rc_to_mbg_errno (int sys_errno) |
const char * | mbgioctl_get_name (long code) |
#define _cmd_from_ioctl_code | ( | _ioc | ) | _IOC_NR( _ioc ) |
Definition at line 330 of file mbgioctl.h.
#define _MBG_IO _IO |
Definition at line 326 of file mbgioctl.h.
#define _MBG_IOG | ( | _t, | |
_n, | |||
_s | |||
) | _MBG_IOW( _t, _n, _s ) |
Definition at line 428 of file mbgioctl.h.
#define _MBG_IOR _IOR |
Definition at line 327 of file mbgioctl.h.
#define _MBG_IOW _IOW |
Definition at line 328 of file mbgioctl.h.
#define _MBG_SUPP_VAR_ACC_SIZE 0 |
Definition at line 374 of file mbgioctl.h.
#define IOCTL_CODES_TABLE |
An initializer for a table of IOCTL codes and associated names.
This can e.g. initialize an array of MBG_CODE_NAME_TABLE_ENTRY elements and may be helpful when debugging.
Definition at line 753 of file mbgioctl.h.
#define IOTYPE 'M' |
Definition at line 324 of file mbgioctl.h.
#define MBG_HAS_POSIX_IOCTL 1 |
Definition at line 198 of file mbgioctl.h.
#define USE_DEBUG_PORT 0 |
Definition at line 193 of file mbgioctl.h.
#define USE_IOCTL_GENERIC_REQ 1 |
Definition at line 393 of file mbgioctl.h.
enum MBG_REQ_PRIVL |
Privilege levels for IOCTL codes.
IOCTLs can be used to do different things ranging from simply reading a timestamp up to forcing a GPS receiver into boot mode which may completely mess up the time keeping on the PC.
These codes are used to determine a privilege level required to execute a specific IOCTL command.
How to determine if a calling process has sufficient privileges depends strongly on the rights management features provided by the underlying OS (e.g simple user/group rights, ACLs, Linux capabilities, Windows privileges) so this needs to be implemented in the OS-specific code of a driver.
Implementation should be done in a way which introduces as low latency as possible when reading time stamps from a device.
Enumerator | |
---|---|
MBG_REQ_PRIVL_NONE | |
MBG_REQ_PRIVL_EXT_STATUS | |
MBG_REQ_PRIVL_CFG_READ | |
MBG_REQ_PRIVL_CFG_WRITE | |
MBG_REQ_PRIVL_SYSTEM | |
N_MBG_REQ_PRIVL |
Definition at line 947 of file mbgioctl.h.
|
static |
Determine the privilege level required to execute a specific IOCTL command.
ioctl_code | The IOCTL code for which to return the privilege level |
Definition at line 973 of file mbgioctl.h.
References IOCTL_CHK_DEV_FEAT, IOCTL_CLR_EVT_LOG, IOCTL_DEV_CAN_CLR_UCAP_BUFF, IOCTL_DEV_HAS_CAB_LEN, IOCTL_DEV_HAS_CORR_INFO, IOCTL_DEV_HAS_DEBUG_STATUS, IOCTL_DEV_HAS_EVENT_TIME, IOCTL_DEV_HAS_EVT_LOG, IOCTL_DEV_HAS_FAST_HR_TIMESTAMP, IOCTL_DEV_HAS_GENERIC_IO, IOCTL_DEV_HAS_GPIO, IOCTL_DEV_HAS_GPS_DATA, IOCTL_DEV_HAS_GPS_TIME_SCALE, IOCTL_DEV_HAS_GPS_UTC_PARM, IOCTL_DEV_HAS_HR_TIME, IOCTL_DEV_HAS_IRIG, IOCTL_DEV_HAS_IRIG_CTRL_BITS, IOCTL_DEV_HAS_IRIG_TIME, IOCTL_DEV_HAS_IRIG_TX, IOCTL_DEV_HAS_LAN_INTF, IOCTL_DEV_HAS_MOD, IOCTL_DEV_HAS_OPT_FLAGS, IOCTL_DEV_HAS_PCI_ASIC_FEATURES, IOCTL_DEV_HAS_PCI_ASIC_VERSION, IOCTL_DEV_HAS_PCPS_TZDL, IOCTL_DEV_HAS_PTP, IOCTL_DEV_HAS_PTP_UNICAST, IOCTL_DEV_HAS_PZF, IOCTL_DEV_HAS_RAW_IRIG_DATA, IOCTL_DEV_HAS_RECEIVER_INFO, IOCTL_DEV_HAS_REF_OFFS, IOCTL_DEV_HAS_SERIAL_HS, IOCTL_DEV_HAS_SIGNAL, IOCTL_DEV_HAS_SYNTH, IOCTL_DEV_HAS_TR_DISTANCE, IOCTL_DEV_HAS_TZ, IOCTL_DEV_HAS_TZCODE, IOCTL_DEV_HAS_TZDL, IOCTL_DEV_HAS_UCAP, IOCTL_DEV_HAS_XMR, IOCTL_DEV_IS_DCF, IOCTL_DEV_IS_GNSS, IOCTL_DEV_IS_GPS, IOCTL_DEV_IS_IRIG_RX, IOCTL_DEV_IS_LWR, IOCTL_DEV_IS_MSF, IOCTL_DEV_IS_PTP, IOCTL_DEV_IS_WWVB, IOCTL_GET_ALL_GNSS_SAT_INFO, IOCTL_GET_ALL_GPIO_INFO, IOCTL_GET_ALL_GPIO_STATUS, IOCTL_GET_ALL_PTP_UC_MASTER_INFO, IOCTL_GET_ALL_XMR_INFO, IOCTL_GET_ALL_XMR_STATUS, IOCTL_GET_CORR_INFO, IOCTL_GET_CYCLES_FREQUENCY, IOCTL_GET_DEBUG_STATUS, IOCTL_GET_FAST_HR_TIMESTAMP, IOCTL_GET_FAST_HR_TIMESTAMP_CYCLES, IOCTL_GET_FIRST_EVT_LOG_ENTRY, IOCTL_GET_GNSS_MODE_INFO, IOCTL_GET_GPIO_CFG_LIMITS, IOCTL_GET_GPS_ALL_PORT_INFO, IOCTL_GET_GPS_ALL_POUT_INFO, IOCTL_GET_GPS_ALL_STR_TYPE_INFO, IOCTL_GET_GPS_ANT_CABLE_LEN, IOCTL_GET_GPS_ANT_INFO, IOCTL_GET_GPS_BVAR_STAT, IOCTL_GET_GPS_ENABLE_FLAGS, IOCTL_GET_GPS_IDENT, IOCTL_GET_GPS_PORT_PARM, IOCTL_GET_GPS_POS, IOCTL_GET_GPS_RECEIVER_INFO, IOCTL_GET_GPS_STAT_INFO, IOCTL_GET_GPS_SW_REV, IOCTL_GET_GPS_TIME, IOCTL_GET_GPS_TIME_SCALE_INFO, IOCTL_GET_GPS_TZDL, IOCTL_GET_GPS_UCAP, IOCTL_GET_GPS_UTC_PARM, IOCTL_GET_IP4_SETTINGS, IOCTL_GET_IP4_STATE, IOCTL_GET_IRIG_CTRL_BITS, IOCTL_GET_IRIG_TIME, IOCTL_GET_IRQ_STAT_INFO, IOCTL_GET_LAN_IF_INFO, IOCTL_GET_MAPPED_MEM_ADDR, IOCTL_GET_MBG_OPT_INFO, IOCTL_GET_NEXT_EVT_LOG_ENTRY, IOCTL_GET_NUM_EVT_LOG_ENTRIES, IOCTL_GET_PCI_ASIC_FEATURES, IOCTL_GET_PCI_ASIC_VERSION, IOCTL_GET_PCPS_DEV, IOCTL_GET_PCPS_DRVR_INFO, IOCTL_GET_PCPS_HR_TIME, IOCTL_GET_PCPS_HR_TIME_CYCLES, IOCTL_GET_PCPS_IRIG_RX_INFO, IOCTL_GET_PCPS_IRIG_TX_INFO, IOCTL_GET_PCPS_SERIAL, IOCTL_GET_PCPS_STATUS_PORT, IOCTL_GET_PCPS_SYNC_TIME, IOCTL_GET_PCPS_TIME, IOCTL_GET_PCPS_TIME_CYCLES, IOCTL_GET_PCPS_TIME_SEC_CHANGE, IOCTL_GET_PCPS_TZCODE, IOCTL_GET_PCPS_TZDL, IOCTL_GET_PCPS_UCAP_ENTRIES, IOCTL_GET_PCPS_UCAP_EVENT, IOCTL_GET_PTP_CFG_INFO, IOCTL_GET_PTP_STATE, IOCTL_GET_RAW_IRIG_DATA, IOCTL_GET_REF_OFFS, IOCTL_GET_SYNTH, IOCTL_GET_SYNTH_STATE, IOCTL_GET_TIME_INFO_HRT, IOCTL_GET_TIME_INFO_TSTAMP, IOCTL_GET_TR_DISTANCE, IOCTL_GET_XMR_HOLDOVER_STATUS, IOCTL_GET_XMR_INSTANCES, IOCTL_MBG_DBG_CLR_ALL, IOCTL_MBG_DBG_CLR_BIT, IOCTL_MBG_DBG_GET_PORT_ADDR, IOCTL_MBG_DBG_SET_BIT, IOCTL_MBG_DBG_SET_PORT_ADDR, IOCTL_PCPS_CLR_UCAP_BUFF, IOCTL_PCPS_GENERIC_IO, IOCTL_PCPS_GENERIC_READ, IOCTL_PCPS_GENERIC_READ_GPS, IOCTL_PCPS_GENERIC_WRITE, IOCTL_PCPS_GENERIC_WRITE_GPS, IOCTL_PTP_UC_MASTER_CFG_LIMITS, IOCTL_SET_GNSS_MODE_SETTINGS, IOCTL_SET_GPIO_SETTINGS_IDX, IOCTL_SET_GPS_ANT_CABLE_LEN, IOCTL_SET_GPS_CMD, IOCTL_SET_GPS_ENABLE_FLAGS, IOCTL_SET_GPS_PORT_PARM, IOCTL_SET_GPS_PORT_SETTINGS_IDX, IOCTL_SET_GPS_POS_LLA, IOCTL_SET_GPS_POS_XYZ, IOCTL_SET_GPS_POUT_SETTINGS_IDX, IOCTL_SET_GPS_TIME, IOCTL_SET_GPS_TIME_SCALE_SETTINGS, IOCTL_SET_GPS_TZDL, IOCTL_SET_GPS_UTC_PARM, IOCTL_SET_IP4_SETTINGS, IOCTL_SET_MBG_OPT_SETTINGS, IOCTL_SET_PCPS_EVENT_TIME, IOCTL_SET_PCPS_IRIG_RX_SETTINGS, IOCTL_SET_PCPS_IRIG_TX_SETTINGS, IOCTL_SET_PCPS_SERIAL, IOCTL_SET_PCPS_TIME, IOCTL_SET_PCPS_TZCODE, IOCTL_SET_PCPS_TZDL, IOCTL_SET_PTP_CFG_SETTINGS, IOCTL_SET_PTP_UC_MASTER_SETTINGS_IDX, IOCTL_SET_REF_OFFS, IOCTL_SET_SYNTH, IOCTL_SET_TR_DISTANCE, IOCTL_SET_XMR_SETTINGS_IDX, IOCTL_UNMAP_MAPPED_MEM, MBG_REQ_PRIVL_CFG_READ, MBG_REQ_PRIVL_CFG_WRITE, MBG_REQ_PRIVL_EXT_STATUS, MBG_REQ_PRIVL_NONE, MBG_REQ_PRIVL_SYSTEM, mbgioctl_get_name(), and mbgioctl_rc_to_mbg_errno().
Referenced by mbgclock_unlocked_ioctl().
const char* mbgioctl_get_name | ( | long | code | ) |
Referenced by ioctl_get_required_privilege(), ioctl_switch(), and mbgclock_unlocked_ioctl().
int mbgioctl_rc_to_mbg_errno | ( | int | sys_errno | ) |
Referenced by ioctl_get_required_privilege().