mbgtools-lx  4.2.8
mbgioctl.h File Reference
#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
 

Macros

#define USE_DEBUG_PORT   0
 
#define MBG_HAS_POSIX_IOCTL   1
 
#define IOTYPE   'M'
 
#define _MBG_IO   _IO
 
#define _MBG_IOR   _IOR
 
#define _MBG_IOW   _IOW
 
#define _cmd_from_ioctl_code(_ioc)   _IOC_NR( _ioc )
 
#define _MBG_SUPP_VAR_ACC_SIZE   0
 
#define USE_IOCTL_GENERIC_REQ   1
 
#define _MBG_IOG(_t, _n, _s)   _MBG_IOW( _t, _n, _s )
 
#define IOCTL_GET_PCPS_DRVR_INFO   _MBG_IOR( IOTYPE, 0x00, PCPS_DRVR_INFO )
 
#define IOCTL_GET_PCPS_DEV   _MBG_IOR( IOTYPE, 0x01, PCPS_DEV )
 
#define IOCTL_GET_PCPS_STATUS_PORT   _MBG_IOR( IOTYPE, 0x02, PCPS_STATUS_PORT )
 
#define IOCTL_PCPS_GENERIC_READ   _MBG_IOG( IOTYPE, 0x03, IOCTL_GENERIC_REQ )
 
#define IOCTL_PCPS_GENERIC_WRITE   _MBG_IOG( IOTYPE, 0x04, IOCTL_GENERIC_REQ )
 
#define IOCTL_PCPS_GENERIC_READ_GPS   _MBG_IOG( IOTYPE, 0x05, IOCTL_GENERIC_REQ )
 
#define IOCTL_PCPS_GENERIC_WRITE_GPS   _MBG_IOG( IOTYPE, 0x06, IOCTL_GENERIC_REQ )
 
#define IOCTL_GET_PCPS_TIME   _MBG_IOR( IOTYPE, 0x10, PCPS_TIME )
 
#define IOCTL_SET_PCPS_TIME   _MBG_IOW( IOTYPE, 0x11, PCPS_STIME )
 
#define IOCTL_GET_PCPS_SYNC_TIME   _MBG_IOR( IOTYPE, 0x12, PCPS_TIME )
 
#define IOCTL_GET_PCPS_TIME_SEC_CHANGE   _MBG_IOR( IOTYPE, 0x13, PCPS_TIME )
 
#define IOCTL_GET_PCPS_HR_TIME   _MBG_IOR( IOTYPE, 0x14, PCPS_HR_TIME )
 
#define IOCTL_SET_PCPS_EVENT_TIME   _MBG_IOW( IOTYPE, 0x15, PCPS_TIME_STAMP )
 
#define IOCTL_GET_PCPS_SERIAL   _MBG_IOR( IOTYPE, 0x16, PCPS_SERIAL )
 
#define IOCTL_SET_PCPS_SERIAL   _MBG_IOW( IOTYPE, 0x17, PCPS_SERIAL )
 
#define IOCTL_GET_PCPS_TZCODE   _MBG_IOR( IOTYPE, 0x18, PCPS_TZCODE )
 
#define IOCTL_SET_PCPS_TZCODE   _MBG_IOW( IOTYPE, 0x19, PCPS_TZCODE )
 
#define IOCTL_GET_PCPS_TZDL   _MBG_IOR( IOTYPE, 0x1A, PCPS_TZDL )
 
#define IOCTL_SET_PCPS_TZDL   _MBG_IOW( IOTYPE, 0x1B, PCPS_TZDL )
 
#define IOCTL_GET_REF_OFFS   _MBG_IOR( IOTYPE, 0x1C, MBG_REF_OFFS )
 
#define IOCTL_SET_REF_OFFS   _MBG_IOW( IOTYPE, 0x1D, MBG_REF_OFFS )
 
#define IOCTL_GET_MBG_OPT_INFO   _MBG_IOR( IOTYPE, 0x1E, MBG_OPT_INFO )
 
#define IOCTL_SET_MBG_OPT_SETTINGS   _MBG_IOW( IOTYPE, 0x1F, MBG_OPT_SETTINGS )
 
#define IOCTL_GET_PCPS_IRIG_RX_INFO   _MBG_IOR( IOTYPE, 0x20, IRIG_INFO )
 
#define IOCTL_SET_PCPS_IRIG_RX_SETTINGS   _MBG_IOW( IOTYPE, 0x21, IRIG_SETTINGS )
 
#define IOCTL_PCPS_CLR_UCAP_BUFF   _MBG_IO( IOTYPE, 0x22 )
 
#define IOCTL_GET_PCPS_UCAP_ENTRIES   _MBG_IOR( IOTYPE, 0x23, PCPS_UCAP_ENTRIES )
 
#define IOCTL_GET_PCPS_UCAP_EVENT   _MBG_IOR( IOTYPE, 0x24, PCPS_HR_TIME )
 
#define IOCTL_GET_GPS_TZDL   _MBG_IOR( IOTYPE, 0x25, TZDL )
 
#define IOCTL_SET_GPS_TZDL   _MBG_IOW( IOTYPE, 0x26, TZDL )
 
#define IOCTL_GET_GPS_SW_REV   _MBG_IOR( IOTYPE, 0x27, SW_REV )
 
#define IOCTL_GET_GPS_BVAR_STAT   _MBG_IOR( IOTYPE, 0x28, BVAR_STAT )
 
#define IOCTL_GET_GPS_TIME   _MBG_IOR( IOTYPE, 0x29, TTM )
 
#define IOCTL_SET_GPS_TIME   _MBG_IOW( IOTYPE, 0x2A, TTM )
 
#define IOCTL_GET_GPS_PORT_PARM   _MBG_IOR( IOTYPE, 0x2B, PORT_PARM )
 
#define IOCTL_SET_GPS_PORT_PARM   _MBG_IOW( IOTYPE, 0x2C, PORT_PARM )
 
#define IOCTL_GET_GPS_ANT_INFO   _MBG_IOR( IOTYPE, 0x2D, ANT_INFO )
 
#define IOCTL_GET_GPS_UCAP   _MBG_IOR( IOTYPE, 0x2E, TTM )
 
#define IOCTL_GET_GPS_ENABLE_FLAGS   _MBG_IOR( IOTYPE, 0x2F, ENABLE_FLAGS )
 
#define IOCTL_SET_GPS_ENABLE_FLAGS   _MBG_IOW( IOTYPE, 0x30, ENABLE_FLAGS )
 
#define IOCTL_GET_GPS_STAT_INFO   _MBG_IOR( IOTYPE, 0x31, STAT_INFO )
 
#define IOCTL_SET_GPS_CMD   _MBG_IOW( IOTYPE, 0x32, GPS_CMD )
 
#define IOCTL_GET_GPS_IDENT   _MBG_IOR( IOTYPE, 0x33, IDENT )
 
#define IOCTL_GET_GPS_POS   _MBG_IOR( IOTYPE, 0x34, POS )
 
#define IOCTL_SET_GPS_POS_XYZ   _MBG_IOW( IOTYPE, 0x35, XYZ )
 
#define IOCTL_SET_GPS_POS_LLA   _MBG_IOW( IOTYPE, 0x36, LLA )
 
#define IOCTL_GET_GPS_ANT_CABLE_LEN   _MBG_IOR( IOTYPE, 0x37, ANT_CABLE_LEN )
 
#define IOCTL_SET_GPS_ANT_CABLE_LEN   _MBG_IOW( IOTYPE, 0x38, ANT_CABLE_LEN )
 
#define IOCTL_GET_GPS_RECEIVER_INFO   _MBG_IOR( IOTYPE, 0x39, RECEIVER_INFO )
 
#define IOCTL_GET_GPS_ALL_STR_TYPE_INFO   _MBG_IOG( IOTYPE, 0x3A, IOCTL_GENERIC_REQ )
 
#define IOCTL_GET_GPS_ALL_PORT_INFO   _MBG_IOG( IOTYPE, 0x3B, IOCTL_GENERIC_REQ )
 
#define IOCTL_SET_GPS_PORT_SETTINGS_IDX   _MBG_IOW( IOTYPE, 0x3C, PORT_SETTINGS_IDX )
 
#define IOCTL_GET_PCI_ASIC_VERSION   _MBG_IOR( IOTYPE, 0x3D, PCI_ASIC_VERSION )
 
#define IOCTL_GET_PCPS_TIME_CYCLES   _MBG_IOR( IOTYPE, 0x3E, PCPS_TIME_CYCLES )
 
#define IOCTL_GET_PCPS_HR_TIME_CYCLES   _MBG_IOR( IOTYPE, 0x3F, PCPS_HR_TIME_CYCLES )
 
#define IOCTL_GET_PCPS_IRIG_TX_INFO   _MBG_IOR( IOTYPE, 0x40, IRIG_INFO )
 
#define IOCTL_SET_PCPS_IRIG_TX_SETTINGS   _MBG_IOW( IOTYPE, 0x41, IRIG_SETTINGS )
 
#define IOCTL_GET_SYNTH   _MBG_IOR( IOTYPE, 0x42, SYNTH )
 
#define IOCTL_SET_SYNTH   _MBG_IOW( IOTYPE, 0x43, SYNTH )
 
#define IOCTL_DEV_IS_GPS   _MBG_IOR( IOTYPE, 0x44, int )
 
#define IOCTL_DEV_IS_DCF   _MBG_IOR( IOTYPE, 0x45, int )
 
#define IOCTL_DEV_IS_IRIG_RX   _MBG_IOR( IOTYPE, 0x46, int )
 
#define IOCTL_DEV_HAS_HR_TIME   _MBG_IOR( IOTYPE, 0x47, int )
 
#define IOCTL_DEV_HAS_CAB_LEN   _MBG_IOR( IOTYPE, 0x48, int )
 
#define IOCTL_DEV_HAS_TZDL   _MBG_IOR( IOTYPE, 0x49, int )
 
#define IOCTL_DEV_HAS_PCPS_TZDL   _MBG_IOR( IOTYPE, 0x4A, int )
 
#define IOCTL_DEV_HAS_TZCODE   _MBG_IOR( IOTYPE, 0x4B, int )
 
#define IOCTL_DEV_HAS_TZ   _MBG_IOR( IOTYPE, 0x4C, int )
 
#define IOCTL_DEV_HAS_EVENT_TIME   _MBG_IOR( IOTYPE, 0x4D, int )
 
#define IOCTL_DEV_HAS_RECEIVER_INFO   _MBG_IOR( IOTYPE, 0x4E, int )
 
#define IOCTL_DEV_CAN_CLR_UCAP_BUFF   _MBG_IOR( IOTYPE, 0x4F, int )
 
#define IOCTL_DEV_HAS_UCAP   _MBG_IOR( IOTYPE, 0x50, int )
 
#define IOCTL_DEV_HAS_IRIG_TX   _MBG_IOR( IOTYPE, 0x51, int )
 
#define IOCTL_DEV_HAS_SERIAL_HS   _MBG_IOR( IOTYPE, 0x52, int )
 
#define IOCTL_DEV_HAS_SIGNAL   _MBG_IOR( IOTYPE, 0x53, int )
 
#define IOCTL_DEV_HAS_MOD   _MBG_IOR( IOTYPE, 0x54, int )
 
#define IOCTL_DEV_HAS_IRIG   _MBG_IOR( IOTYPE, 0x55, int )
 
#define IOCTL_DEV_HAS_REF_OFFS   _MBG_IOR( IOTYPE, 0x56, int )
 
#define IOCTL_DEV_HAS_OPT_FLAGS   _MBG_IOR( IOTYPE, 0x57, int )
 
#define IOCTL_DEV_HAS_GPS_DATA   _MBG_IOR( IOTYPE, 0x58, int )
 
#define IOCTL_DEV_HAS_SYNTH   _MBG_IOR( IOTYPE, 0x59, int )
 
#define IOCTL_DEV_HAS_GENERIC_IO   _MBG_IOR( IOTYPE, 0x5A, int )
 
#define IOCTL_PCPS_GENERIC_IO   _MBG_IOG( IOTYPE, 0x5B, IOCTL_GENERIC_REQ )
 
#define IOCTL_GET_SYNTH_STATE   _MBG_IOR( IOTYPE, 0x5C, SYNTH_STATE )
 
#define IOCTL_GET_GPS_ALL_POUT_INFO   _MBG_IOG( IOTYPE, 0x5D, IOCTL_GENERIC_REQ )
 
#define IOCTL_SET_GPS_POUT_SETTINGS_IDX   _MBG_IOW( IOTYPE, 0x5E, POUT_SETTINGS_IDX )
 
#define IOCTL_GET_MAPPED_MEM_ADDR   _MBG_IOR( IOTYPE, 0x5F, PCPS_MAPPED_MEM )
 
#define IOCTL_UNMAP_MAPPED_MEM   _MBG_IOR( IOTYPE, 0x60, PCPS_MAPPED_MEM )
 
#define IOCTL_GET_PCI_ASIC_FEATURES   _MBG_IOR( IOTYPE, 0x61, PCI_ASIC_FEATURES )
 
#define IOCTL_DEV_HAS_PCI_ASIC_FEATURES   _MBG_IOR( IOTYPE, 0x62, int )
 
#define IOCTL_DEV_HAS_PCI_ASIC_VERSION   _MBG_IOR( IOTYPE, 0x63, int )
 
#define IOCTL_DEV_IS_MSF   _MBG_IOR( IOTYPE, 0x64, int )
 
#define IOCTL_DEV_IS_LWR   _MBG_IOR( IOTYPE, 0x65, int )
 
#define IOCTL_DEV_IS_WWVB   _MBG_IOR( IOTYPE, 0x66, int )
 
#define IOCTL_GET_IRQ_STAT_INFO   _MBG_IOR( IOTYPE, 0x67, PCPS_IRQ_STAT_INFO )
 
#define IOCTL_GET_CYCLES_FREQUENCY   _MBG_IOR( IOTYPE, 0x68, MBG_PC_CYCLES_FREQUENCY )
 
#define IOCTL_DEV_HAS_FAST_HR_TIMESTAMP   _MBG_IOR( IOTYPE, 0x69, int )
 
#define IOCTL_GET_FAST_HR_TIMESTAMP_CYCLES   _MBG_IOR( IOTYPE, 0x6A, PCPS_TIME_STAMP_CYCLES )
 
#define IOCTL_GET_FAST_HR_TIMESTAMP   _MBG_IOR( IOTYPE, 0x6B, PCPS_TIME_STAMP )
 
#define IOCTL_DEV_HAS_GPS_TIME_SCALE   _MBG_IOR( IOTYPE, 0x6C, int )
 
#define IOCTL_GET_GPS_TIME_SCALE_INFO   _MBG_IOR( IOTYPE, 0x6D, MBG_TIME_SCALE_INFO )
 
#define IOCTL_SET_GPS_TIME_SCALE_SETTINGS   _MBG_IOW( IOTYPE, 0x6E, MBG_TIME_SCALE_SETTINGS )
 
#define IOCTL_DEV_HAS_GPS_UTC_PARM   _MBG_IOR( IOTYPE, 0x6F, int )
 
#define IOCTL_GET_GPS_UTC_PARM   _MBG_IOR( IOTYPE, 0x70, UTC )
 
#define IOCTL_SET_GPS_UTC_PARM   _MBG_IOW( IOTYPE, 0x71, UTC )
 
#define IOCTL_DEV_HAS_IRIG_CTRL_BITS   _MBG_IOR( IOTYPE, 0x72, int )
 
#define IOCTL_GET_IRIG_CTRL_BITS   _MBG_IOR( IOTYPE, 0x73, MBG_IRIG_CTRL_BITS )
 
#define IOCTL_DEV_HAS_LAN_INTF   _MBG_IOR( IOTYPE, 0x74, int )
 
#define IOCTL_GET_LAN_IF_INFO   _MBG_IOR( IOTYPE, 0x75, LAN_IF_INFO )
 
#define IOCTL_GET_IP4_STATE   _MBG_IOR( IOTYPE, 0x76, IP4_SETTINGS )
 
#define IOCTL_GET_IP4_SETTINGS   _MBG_IOR( IOTYPE, 0x77, IP4_SETTINGS )
 
#define IOCTL_SET_IP4_SETTINGS   _MBG_IOW( IOTYPE, 0x78, IP4_SETTINGS )
 
#define IOCTL_DEV_IS_PTP   _MBG_IOR( IOTYPE, 0x79, int )
 
#define IOCTL_DEV_HAS_PTP   _MBG_IOR( IOTYPE, 0x7A, int )
 
#define IOCTL_GET_PTP_STATE   _MBG_IOR( IOTYPE, 0x7B, PTP_STATE )
 
#define IOCTL_GET_PTP_CFG_INFO   _MBG_IOR( IOTYPE, 0x7C, PTP_CFG_INFO )
 
#define IOCTL_SET_PTP_CFG_SETTINGS   _MBG_IOW( IOTYPE, 0x7D, PTP_CFG_SETTINGS )
 
#define IOCTL_DEV_HAS_IRIG_TIME   _MBG_IOR( IOTYPE, 0x7E, int )
 
#define IOCTL_GET_IRIG_TIME   _MBG_IOR( IOTYPE, 0x7F, PCPS_IRIG_TIME )
 
#define IOCTL_GET_TIME_INFO_HRT   _MBG_IOR( IOTYPE, 0x80, MBG_TIME_INFO_HRT )
 
#define IOCTL_GET_TIME_INFO_TSTAMP   _MBG_IOR( IOTYPE, 0x81, MBG_TIME_INFO_TSTAMP )
 
#define IOCTL_DEV_HAS_RAW_IRIG_DATA   _MBG_IOR( IOTYPE, 0x82, int )
 
#define IOCTL_GET_RAW_IRIG_DATA   _MBG_IOR( IOTYPE, 0x83, MBG_RAW_IRIG_DATA )
 
#define IOCTL_DEV_HAS_PTP_UNICAST   _MBG_IOR( IOTYPE, 0x84, int )
 
#define IOCTL_PTP_UC_MASTER_CFG_LIMITS   _MBG_IOR( IOTYPE, 0x85, PTP_UC_MASTER_CFG_LIMITS )
 
#define IOCTL_GET_ALL_PTP_UC_MASTER_INFO   _MBG_IOG( IOTYPE, 0x86, IOCTL_GENERIC_REQ )
 
#define IOCTL_SET_PTP_UC_MASTER_SETTINGS_IDX   _MBG_IOW( IOTYPE, 0x87, PTP_UC_MASTER_SETTINGS_IDX )
 
#define IOCTL_DEV_HAS_PZF   _MBG_IOR( IOTYPE, 0x88, int )
 
#define IOCTL_DEV_HAS_CORR_INFO   _MBG_IOR( IOTYPE, 0x89, int )
 
#define IOCTL_DEV_HAS_TR_DISTANCE   _MBG_IOR( IOTYPE, 0x8A, int )
 
#define IOCTL_GET_CORR_INFO   _MBG_IOR( IOTYPE, 0x8B, CORR_INFO )
 
#define IOCTL_GET_TR_DISTANCE   _MBG_IOR( IOTYPE, 0x8C, TR_DISTANCE )
 
#define IOCTL_SET_TR_DISTANCE   _MBG_IOW( IOTYPE, 0x8D, TR_DISTANCE )
 
#define IOCTL_DEV_HAS_DEBUG_STATUS   _MBG_IOR( IOTYPE, 0x8E, int )
 
#define IOCTL_GET_DEBUG_STATUS   _MBG_IOR( IOTYPE, 0x8F, MBG_DEBUG_STATUS )
 
#define IOCTL_DEV_HAS_EVT_LOG   _MBG_IOR( IOTYPE, 0x90, int )
 
#define IOCTL_CLR_EVT_LOG   _MBG_IO( IOTYPE, 0x91 )
 
#define IOCTL_GET_NUM_EVT_LOG_ENTRIES   _MBG_IOR( IOTYPE, 0x92, MBG_NUM_EVT_LOG_ENTRIES )
 
#define IOCTL_GET_FIRST_EVT_LOG_ENTRY   _MBG_IOR( IOTYPE, 0x93, MBG_EVT_LOG_ENTRY )
 
#define IOCTL_GET_NEXT_EVT_LOG_ENTRY   _MBG_IOR( IOTYPE, 0x94, MBG_EVT_LOG_ENTRY )
 
#define IOCTL_DEV_IS_GNSS   _MBG_IOR( IOTYPE, 0x95, int )
 
#define IOCTL_GET_GNSS_MODE_INFO   _MBG_IOR( IOTYPE, 0x96, MBG_GNSS_MODE_INFO )
 
#define IOCTL_SET_GNSS_MODE_SETTINGS   _MBG_IOW( IOTYPE, 0x97, MBG_GNSS_MODE_SETTINGS )
 
#define IOCTL_GET_ALL_GNSS_SAT_INFO   _MBG_IOG( IOTYPE, 0x98, IOCTL_GENERIC_REQ )
 
#define IOCTL_DEV_HAS_GPIO   _MBG_IOR( IOTYPE, 0x99, int )
 
#define IOCTL_GET_GPIO_CFG_LIMITS   _MBG_IOR( IOTYPE, 0x9A, MBG_GPIO_CFG_LIMITS )
 
#define IOCTL_GET_ALL_GPIO_INFO   _MBG_IOG( IOTYPE, 0x9B, IOCTL_GENERIC_REQ )
 
#define IOCTL_SET_GPIO_SETTINGS_IDX   _MBG_IOW( IOTYPE, 0x9C, MBG_GPIO_SETTINGS_IDX )
 
#define IOCTL_DEV_HAS_XMR   _MBG_IOR( IOTYPE, 0x9D, int )
 
#define IOCTL_GET_XMR_INSTANCES   _MBG_IOR( IOTYPE, 0x9E, XMULTI_REF_INSTANCES )
 
#define IOCTL_GET_ALL_XMR_INFO   _MBG_IOG( IOTYPE, 0x9F, IOCTL_GENERIC_REQ )
 
#define IOCTL_SET_XMR_SETTINGS_IDX   _MBG_IOW( IOTYPE, 0xA0, XMULTI_REF_SETTINGS_IDX )
 
#define IOCTL_GET_ALL_XMR_STATUS   _MBG_IOG( IOTYPE, 0xA1, IOCTL_GENERIC_REQ )
 
#define IOCTL_GET_XMR_HOLDOVER_STATUS   _MBG_IOR( IOTYPE, 0xA2, XMR_HOLDOVER_STATUS )
 
#define IOCTL_GET_ALL_GPIO_STATUS   _MBG_IOG( IOTYPE, 0xA3, IOCTL_GENERIC_REQ )
 
#define IOCTL_CHK_DEV_FEAT   _MBG_IOW( IOTYPE, 0xA4, IOCTL_DEV_FEAT_REQ )
 
#define IOCTL_MBG_DBG_GET_PORT_ADDR   _MBG_IOR( IOTYPE, 0xF0, uint16_t )
 
#define IOCTL_MBG_DBG_SET_PORT_ADDR   _MBG_IOW( IOTYPE, 0xF1, uint16_t )
 
#define IOCTL_MBG_DBG_SET_BIT   _MBG_IOW( IOTYPE, 0xF2, uint8_t )
 
#define IOCTL_MBG_DBG_CLR_BIT   _MBG_IOW( IOTYPE, 0xF3, uint8_t )
 
#define IOCTL_MBG_DBG_CLR_ALL   _MBG_IO( IOTYPE, 0xF4 )
 
#define IOCTL_CODES_TABLE
 An initializer for a table of IOCTL codes and associated names. More...
 

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)
 

Macro Definition Documentation

◆ _cmd_from_ioctl_code

#define _cmd_from_ioctl_code (   _ioc)    _IOC_NR( _ioc )

Definition at line 330 of file mbgioctl.h.

◆ _MBG_IO

#define _MBG_IO   _IO

Definition at line 326 of file mbgioctl.h.

◆ _MBG_IOG

#define _MBG_IOG (   _t,
  _n,
  _s 
)    _MBG_IOW( _t, _n, _s )

Definition at line 428 of file mbgioctl.h.

◆ _MBG_IOR

#define _MBG_IOR   _IOR

Definition at line 327 of file mbgioctl.h.

◆ _MBG_IOW

#define _MBG_IOW   _IOW

Definition at line 328 of file mbgioctl.h.

◆ _MBG_SUPP_VAR_ACC_SIZE

#define _MBG_SUPP_VAR_ACC_SIZE   0

Definition at line 374 of file mbgioctl.h.

◆ IOCTL_CODES_TABLE

#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.

See also
IOCTL_CODES

Definition at line 753 of file mbgioctl.h.

◆ IOTYPE

#define IOTYPE   'M'

Definition at line 324 of file mbgioctl.h.

◆ MBG_HAS_POSIX_IOCTL

#define MBG_HAS_POSIX_IOCTL   1

Definition at line 198 of file mbgioctl.h.

◆ USE_DEBUG_PORT

#define USE_DEBUG_PORT   0

Definition at line 193 of file mbgioctl.h.

◆ USE_IOCTL_GENERIC_REQ

#define USE_IOCTL_GENERIC_REQ   1

Definition at line 393 of file mbgioctl.h.

Enumeration Type Documentation

◆ 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.

Function Documentation

◆ ioctl_get_required_privilege()

static __mbg_inline int ioctl_get_required_privilege ( ulong  ioctl_code)
static

Determine the privilege level required to execute a specific IOCTL command.

Parameters
ioctl_codeThe IOCTL code for which to return the privilege level
Returns
One of the enumerated privilege levels
-1 for unknown IOCTL codes

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().

◆ mbgioctl_get_name()

const char* mbgioctl_get_name ( long  code)

◆ mbgioctl_rc_to_mbg_errno()

int mbgioctl_rc_to_mbg_errno ( int  sys_errno)