mbgtools-lx  4.2.8
pcpsdrvr.h File Reference
#include <mbg_tgt.h>
#include <xdevfeat.h>
#include <pcpsiobf.h>
#include <mbg_lx.h>
#include <pcpsdev.h>
#include <cfg_hlp.h>
#include <mbgmutex.h>
#include <pci_asic.h>
#include <mbgerror.h>
#include <use_pack.h>
#include <mbggenio.h>
#include <mbgddmsg.h>
#include <stddef.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <rsrc.h>

Go to the source code of this file.

Data Structures

struct  PCPS_RSRC_INFO
 Resource info summary for a device. More...
 
union  PCPS_MM_LAYOUT
 Memory layout of Meinberg PCI interface register. More...
 
struct  PCPS_MM_LAYOUT::pex8311
 
struct  PCPS_MM_LAYOUT::mbgpex
 
struct  PCPS_DDEV_s
 

Macros

#define USE_LOCAL_IO_BUFFER   0
 
#define _DEFAULT_PCPS_USE_CLOCK_TICK   1
 
#define _DEFAULT_PCPS_USE_ISA   defined( MBG_ARCH_X86 )
 
#define _DEFAULT_PCPS_USE_MCA   0
 
#define _DEFAULT_PCPS_USE_PCI   1
 
#define _DEFAULT_PCPS_USE_ISA_PNP   0
 
#define _DEFAULT_PCPS_USE_PCI_PNP   _DEFAULT_MBG_TGT_LINUX_USE_PCI_PNP
 
#define _DEFAULT_PCPS_USE_USB   _DEFAULT_MBG_TGT_LINUX_USE_USB
 
#define _DEFAULT_PCPS_USE_RSRCMGR   1
 
#define _PCPS_USE_CLOCK_TICK   _DEFAULT_PCPS_USE_CLOCK_TICK
 
#define _PCPS_USE_ISA   _DEFAULT_PCPS_USE_ISA
 
#define _PCPS_USE_MCA   _DEFAULT_PCPS_USE_MCA
 
#define _PCPS_USE_ISA_PNP   _DEFAULT_PCPS_USE_ISA_PNP
 
#define _PCPS_USE_PCI_PNP   _DEFAULT_PCPS_USE_PCI_PNP
 
#define _PCPS_USE_USB   _DEFAULT_PCPS_USE_USB
 
#define _PCPS_USE_RSRCMGR   _DEFAULT_PCPS_USE_RSRCMGR
 
#define _PCPS_USE_PCI_BIOS   ( _PCPS_USE_PCI && !_PCPS_USE_PCI_PNP )
 
#define _PCPS_USE_PNP   ( _PCPS_USE_PCI_PNP || _PCPS_USE_ISA_PNP || _PCPS_USE_USB )
 
#define _MBG_INIT_CODE_ATTR
 
#define DEBUG_DRVR   0
 
#define DEBUG_DEV_INIT   0
 
#define DEBUG_USB_IO   0
 
#define DEBUG_IOCTL   0
 
#define _ext   extern
 
#define MBG_DRVR_NAME   "mbgclock"
 
#define _DEFAULT_PCPS_USE_MM_IO   ( MBG_TGT_SUPP_MEM_ACC && !MBG_USE_MM_IO_FOR_PCI )
 
#define _PCPS_USE_MM_IO   _DEFAULT_PCPS_USE_MM_IO
 
#define _pcps_kmalloc(_sz)   kmalloc( _sz, GFP_ATOMIC )
 
#define _pcps_kfree(_p, _sz)   kfree( _p )
 
#define _pcps_sem_inc(_pddev)
 
#define _pcps_sem_dec(_pddev)
 
#define _PCPS_STATIC_DEV_LIST   ( !_PCPS_USE_PNP )
 
#define PCPS_TIMEOUT_CNT   ( (ulong)( 200 * HZ ) / 1000 )
 
#define N_PCPS_MEM_RSRC   2
 The max number of bus memory resources used by a device. More...
 
#define MAX_PCPS_RSRC   ( N_PCPS_MEM_RSRC + N_PCPS_PORT_RSRC )
 The max number of bus memory and I/O resources used by a device. More...
 
#define PCPS_ACCESS_MODE_STRS
 Device access mode info strings. More...
 
#define PCPS_ACCESS_MODE_STR_FRCD   " (forced)"
 String to append if access mode has been forced. More...
 
#define PCPS_DECODE_WIDTH_PCI   16
 The number of address lines decoded by a PCI clock. More...
 
#define MCA_ID_PS31   0x6AAC
 MCA adapter ID assigned by IBM. More...
 
#define MCA_ID_PS31_OLD   0x6303
 MCA adapter ID assigned by Meinberg, used with the first series of PS31 boards. More...
 
#define PCPS_NUM_PORTS_MCA   16
 The total number of ports acquired by an MCA device. More...
 
#define PCPS_DECODE_WIDTH_MCA   16
 The number of address lines decoded by an MCA device. More...
 
#define ISA_ID_PCPS   MCA_ID_PS31
 A board ID for later ISA bus devices. More...
 
#define PCPS_DEFAULT_PORT   0x0300
 The default port base address for ISA bus devices. More...
 
#define PCPS_NUM_PORTS_ISA   4
 The total number of I/O ports used by an ISA bus device. More...
 
#define PCPS_DECODE_WIDTH_ISA   10
 The number of address lines decoded by an ISA bus device. More...
 
#define PCPS_MAX_ISA_CARDS   N_SUPP_DEV_BUS
 
#define fw_id_ref_pcps   fw_id_ref[0]
 
#define fw_id_ref_gps   fw_id_ref[2]
 
#define _pcps_ddev_type_num(_p)   _pcps_type_num( &(_p)->dev )
 
#define _pcps_ddev_type_name(_p)   _pcps_type_name( &(_p)->dev )
 
#define _pcps_ddev_dev_id(_p)   _pcps_dev_id( &(_p)->dev )
 
#define _pcps_ddev_ref_type(_p)   _pcps_ref_type( &(_p)->dev )
 
#define _pcps_ddev_bus_flags(_p)   _pcps_bus_flags( &(_p)->dev )
 
#define _pcps_ddev_is_gps(_p)   _pcps_is_gps( &(_p)->dev )
 
#define _pcps_ddev_is_dcf(_p)   _pcps_is_dcf( &(_p)->dev )
 
#define _pcps_ddev_is_msf(_p)   _pcps_is_msf( &(_p)->dev )
 
#define _pcps_ddev_is_wwvb(_p)   _pcps_is_wwvb( &(_p)->dev )
 
#define _pcps_ddev_is_irig_rx(_p)   _pcps_is_irig_rx( &(_p)->dev )
 
#define _pcps_ddev_is_ptp(_p)   _pcps_is_ptp( &(_p)->dev )
 
#define _pcps_ddev_is_frc(_p)   _pcps_is_frc( &(_p)->dev )
 
#define _pcps_ddev_is_lwr(_p)   _pcps_is_lwr( &(_p)->dev )
 
#define _pcps_ddev_is_gnss(_p)   _pcps_is_gnss( &(_p)->dev )
 
#define _pcps_ddev_is_isa(_p)   _pcps_is_isa( &(_p)->dev )
 
#define _pcps_ddev_is_mca(_p)   _pcps_is_mca( &(_p)->dev )
 
#define _pcps_ddev_is_pci(_p)   _pcps_is_pci( &(_p)->dev )
 
#define _pcps_ddev_is_usb(_p)   _pcps_is_usb( &(_p)->dev )
 
#define _pcps_ddev_is_usb_v2(_p)   _pcps_is_usb_v2( &(_p)->dev )
 
#define _pcps_ddev_is_pci_s5933(_p)   _pcps_is_pci_s5933( &(_p)->dev )
 
#define _pcps_ddev_is_pci_s5920(_p)   _pcps_is_pci_s5920( &(_p)->dev )
 
#define _pcps_ddev_is_pci_amcc(_p)   _pcps_is_pci_amcc( &(_p)->dev )
 
#define _pcps_ddev_is_pci_asic(_p)   _pcps_is_pci_asic( &(_p)->dev )
 
#define _pcps_ddev_is_pci_pex8311(_p)   _pcps_is_pci_pex8311( &(_p)->dev )
 
#define _pcps_ddev_is_pci_mbgpex(_p)   _pcps_is_pci_mbgpex( &(_p)->dev )
 
#define _pcps_ddev_bus_num(_p)   _pcps_bus_num( &(_p)->dev )
 
#define _pcps_ddev_slot_num(_p)   _pcps_slot_num( &(_p)->dev )
 
#define _pcps_ddev_pci_slot_num(_p)   ( _pcps_ddev_slot_num( _p ) >> 3 )
 
#define _pcps_ddev_pci_fnc_num(_p)   ( _pcps_ddev_slot_num( _p ) & 0x07 )
 
#define _pcps_ddev_short_port_rsrc(_p, _n)   _pcps_short_port_rsrc( &(_p)->dev, _n )
 
#define _pcps_ddev_short_port_base(_p, _n)   _pcps_short_port_base( &(_p)->dev, _n )
 
#define _pcps_ddev_io_rsrc(_p, _n)   ( (_p)->rsrc_info.port[_n] )
 
#define _pcps_ddev_io_base_raw(_p, _n)   ( _pcps_ddev_io_rsrc( _p, _n ).base_raw )
 
#define _pcps_ddev_io_base_mapped(_p, _n)   ( _pcps_ddev_io_rsrc( _p, _n ).base_mapped )
 
#define _pcps_ddev_irq_num(_p)   _pcps_irq_num( &(_p)->dev )
 
#define _pcps_ddev_timeout_clk(_p)   _pcps_timeout_clk( &(_p)->dev )
 
#define _pcps_ddev_mem_rsrc(_p, _n)   ( (_p)->rsrc_info.mem[_n] )
 
#define _pcps_ddev_fw_rev_num(_p)   _pcps_fw_rev_num( &(_p)->dev )
 
#define _pcps_ddev_features(_p)   _pcps_features( &(_p)->dev )
 
#define _pcps_ddev_fw_id(_p)   _pcps_fw_id( &(_p)->dev )
 
#define _pcps_ddev_sernum(_p)   _pcps_sernum( &(_p)->dev )
 
#define _pcps_ddev_sernum_size(_p)   sizeof( (_p)->dev.cfg.sernum )
 
#define _pcps_ddev_raw_asic_version(_p)   ( (_p)->raw_asic_version )
 
#define _pcps_ddev_asic_version(_p)   ( (_p)->asic_version )
 
#define _pcps_ddev_err_flags(_p)   _pcps_err_flags( &(_p)->dev )
 
#define _pcps_ddev_chk_err_flags(_p, _msk)   _pcps_chk_err_flags( &(_p)->dev, _msk )
 
#define _pcps_ddev_set_err_flags(_p, _msk)   _pcps_set_err_flags( &(_p)->dev, _msk )
 
#define _pcps_ddev_clr_err_flags(_p, _msk)   _pcps_clr_err_flags( &(_p)->dev, _msk )
 
#define _pcps_ddev_access_mode_io(_p)   ( (_p)->access_mode == PCPS_ACC_MODE_IO )
 
#define _pcps_ddev_access_mode_mm(_p)
 
#define _pcps_ddev_can_set_time(_p)   _pcps_can_set_time( &(_p)->dev )
 
#define _pcps_ddev_has_serial(_p)   _pcps_has_serial( &(_p)->dev )
 
#define _pcps_ddev_has_sync_time(_p)   _pcps_has_sync_time( &(_p)->dev )
 
#define _pcps_ddev_has_ident(_p)   _pcps_has_ident( &(_p)->dev )
 
#define _pcps_ddev_has_utc_offs(_p)   _pcps_has_utc_offs( &(_p)->dev )
 
#define _pcps_ddev_has_hr_time(_p)   _pcps_has_hr_time( &(_p)->dev )
 
#define _pcps_ddev_has_sernum(_p)   _pcps_has_sernum( &(_p)->dev )
 
#define _pcps_ddev_has_cab_len(_p)   _pcps_has_cab_len( &(_p)->dev )
 
#define _pcps_ddev_has_tzdl(_p)   _pcps_has_tzdl( &(_p)->dev )
 
#define _pcps_ddev_has_pcps_tzdl(_p)   _pcps_has_pcps_tzdl( &(_p)->dev )
 
#define _pcps_ddev_has_tzcode(_p)   _pcps_has_tzcode( &(_p)->dev )
 
#define _pcps_ddev_has_tz(_p)   _pcps_has_tz( &(_p)->dev )
 
#define _pcps_ddev_has_event_time(_p)   _pcps_has_event_time( &(_p)->dev )
 
#define _pcps_ddev_has_receiver_info(_p)   _pcps_has_receiver_info( &(_p)->dev )
 
#define _pcps_ddev_can_clr_ucap_buff(_p)   _pcps_can_clr_ucap_buff( &(_p)->dev )
 
#define _pcps_ddev_has_ucap(_p)   _pcps_has_ucap( &(_p)->dev )
 
#define _pcps_ddev_has_irig_tx(_p)   _pcps_has_irig_tx( &(_p)->dev )
 
#define _pcps_ddev_has_serial_hs(_p)   _pcps_has_serial_hs( &(_p)->dev )
 
#define _pcps_ddev_has_signal(_p)   _pcps_has_signal( &(_p)->dev )
 
#define _pcps_ddev_has_mod(_p)   _pcps_has_mod( &(_p)->dev )
 
#define _pcps_ddev_has_irig(_p)   _pcps_has_irig( &(_p)->dev )
 
#define _pcps_ddev_has_irig_ctrl_bits(_p)   _pcps_has_irig_ctrl_bits( &(_p)->dev )
 
#define _pcps_ddev_has_irig_time(_p)   _pcps_has_irig_time( &(_p)->dev )
 
#define _pcps_ddev_has_raw_irig_data(_p)   _pcps_has_raw_irig_data( &(_p)->dev )
 
#define _pcps_ddev_has_ref_offs(_p)   _pcps_has_ref_offs( &(_p)->dev )
 
#define _pcps_ddev_has_opt_flags(_p)   _pcps_has_opt_flags( &(_p)->dev )
 
#define _pcps_ddev_has_gps_data_16(_p)   _pcps_has_gps_data_16( &(_p)->dev )
 
#define _pcps_ddev_has_gps_data(_p)   _pcps_has_gps_data( &(_p)->dev )
 
#define _pcps_ddev_has_synth(_p)   _pcps_has_synth( &(_p)->dev )
 
#define _pcps_ddev_has_generic_io(_p)   _pcps_has_generic_io( &(_p)->dev )
 
#define _pcps_ddev_has_time_scale(_p)   _pcps_has_time_scale( &(_p)->dev )
 
#define _pcps_ddev_has_utc_parm(_p)   _pcps_has_utc_parm( &(_p)->dev )
 
#define _pcps_ddev_has_asic_version(_p)   _pcps_has_asic_version( &(_p)->dev )
 
#define _pcps_ddev_has_asic_features(_p)   _pcps_has_asic_features( &(_p)->dev )
 
#define _pcps_ddev_has_fast_hr_timestamp(_p)   _pcps_has_fast_hr_timestamp( &(_p)->dev )
 
#define _pcps_ddev_has_lan_intf(_p)   _pcps_has_lan_intf( &(_p)->dev )
 
#define _pcps_ddev_has_ptp(_p)   _pcps_has_ptp( &(_p)->dev )
 
#define _pcps_ddev_has_ptp_unicast(_p)   _pcps_has_ri_ptp_unicast( _ri_addr( _p ) )
 
#define _pcps_ddev_has_pzf(_p)   _pcps_has_pzf( &(_p)->dev )
 
#define _pcps_ddev_has_corr_info(_p)   _pcps_has_corr_info( &(_p)->dev )
 
#define _pcps_ddev_has_tr_distance(_p)   _pcps_has_tr_distance( &(_p)->dev )
 
#define _pcps_ddev_has_evt_log(_p)   _pcps_has_evt_log( &(_p)->dev )
 
#define _pcps_ddev_has_debug_status(_p)   _pcps_has_debug_status( &(_p)->dev )
 
#define _pcps_ddev_has_stat_info(_p)   _pcps_has_stat_info( &(_p)->dev )
 
#define _pcps_ddev_has_stat_info_mode(_p)   _pcps_has_stat_info_mode( &(_p)->dev ) \
 
#define _pcps_ddev_has_stat_info_svs(_p)   _pcps_has_stat_info_svs( &(_p)->dev ) \
 
#define _pcps_ddev_incoming_tfom_ignored(_p)   _pcps_incoming_tfom_ignored( &(_p)->dev )
 
#define _pcps_ddev_pci_cfg_err(_p)   _pcps_pci_cfg_err( &(_p)->dev )
 
#define _pcps_ddev_has_gpio(_p)   _pcps_has_ri_gpio( _ri_addr( _p ) )
 
#define _pcps_ddev_has_xmr(_p)   _pcps_has_ri_xmr( _ri_addr( _p ) )
 
#define _pcps_ddev_fw_has_20ms_bug(_p)   _pcps_fw_has_20ms_bug( &(_p)->dev )
 
#define _pcps_read(_pddev, _cmd, _p, _n)   ( (_pddev)->read( _pddev, (_cmd), (uchar FAR *)(_p), (_n) ) )
 
#define _pcps_write_byte(_pddev, _b)   _pcps_read( (_pddev), (_b), NULL, 0 )
 
#define _pcps_write(_pddev, _cmd, _p, _n)   pcps_write( (_pddev), (_cmd), (uchar FAR *)(_p), (_n) )
 
#define _pcps_read_gps(_pddev, _cmd, _p, _n)   pcps_read_gps( (_pddev), (_cmd), (uchar FAR *)(_p), (_n) )
 
#define _pcps_write_gps(_pddev, _cmd, _p, _n)   pcps_write_gps( (_pddev), (_cmd), (uchar FAR *)(_p), (_n) )
 
#define _pcps_read_var(_pddev, _cmd, _s)   _pcps_read( (_pddev), (_cmd), &(_s), sizeof( (_s) ) )
 
#define _pcps_write_var(_pddev, _cmd, _s)   _pcps_write( (_pddev), (_cmd), &(_s), sizeof( (_s) ) )
 
#define _pcps_read_gps_var(_pddev, _cmd, _s)   _pcps_read_gps( (_pddev), (_cmd), &(_s), sizeof( (_s) ) )
 
#define _pcps_write_gps_var(_pddev, _cmd, _s)   _pcps_write_gps( (_pddev), (_cmd), &(_s), sizeof( (_s) ) )
 
#define _pcps_force_reset(_pddev)   _pcps_write_byte( (_pddev), PCPS_FORCE_RESET )
 
#define _pcps_ddev_status_busy(_d)   ( _pcps_ddev_read_status_port( pddev ) & PCPS_ST_BUSY )
 
#define _pcps_ddev_requires_irig_workaround(_d)
 

Typedefs

typedef struct PCPS_DDEV_s PCPS_DDEV
 
typedef int PCPS_READ_FNC(PCPS_DDEV *pddev, uint8_t cmd, void *buffer, uint16_t count)
 
typedef int PCPS_WRITE_FNC(PCPS_DDEV *pddev, uint8_t cmd, const void *buffer, uint16_t count)
 
typedef int PCPS_DDEV_INIT_FNC(PCPS_DDEV **ppddev)
 
typedef void PCPS_DDEV_CLEANUP_FNC(PCPS_DDEV *pddev)
 
typedef int PCPS_DDEV_REGISTER_FNC(PCPS_DDEV *pddev)
 

Enumerations

enum  PCPS_ACCESS_MODES {
  PCPS_ACC_MODE_NULL, PCPS_ACC_MODE_USB, PCPS_ACC_MODE_IO, PCPS_ACC_MODE_MM,
  PCPS_ACC_MODE_MM16, N_PCPS_ACCESS_MODES
}
 Codes used with PCPS_DDEV::access_mode. More...
 

Functions

static __mbg_inline uint8_t _pcps_ddev_read_status_port (const PCPS_DDEV *pddev)
 
void pcps_dump_data (const void *buffer, size_t count, const char *info)
 
int pcps_write (PCPS_DDEV *pddev, uint8_t cmd, const void *buffer, uint16_t count)
 Write data to a device. More...
 
int pcps_generic_io (PCPS_DDEV *pddev, uint8_t type, const void *in_buff, uint8_t in_cnt, void *out_buff, uint8_t out_cnt)
 Generic I/O function. More...
 
int pcps_read_gps (PCPS_DDEV *pddev, uint8_t data_type, void *buffer, uint16_t count)
 Read a large data structure from a device. More...
 
int pcps_write_gps (PCPS_DDEV *pddev, uint8_t data_type, const void *buffer, uint16_t count)
 Write a large data structure to a device. More...
 
int setup_sernum_and_receiver_info (PCPS_DDEV *pddev)
 Read the serial number and receiver info from the device. More...
 
void check_receiver_info_and_features (PCPS_DDEV *pddev)
 Check the receiver info and features. More...
 
void pcps_release_rsrcs (PCPS_DDEV *pddev)
 Release I/O port and memory resource that have been claimed before. More...
 
PCPS_DEV_TYPEpcps_get_dev_type_table_entry (PCPS_BUS_FLAGS bus_mask, PCPS_DEV_ID dev_id)
 Lookup a specific device in the device table. More...
 
int pcps_init_ddev (PCPS_DDEV **ppddev)
 Allocate and initialize a device info structure. More...
 
void pcps_cleanup_ddev (PCPS_DDEV *pddev)
 Clean up and free a previously initialized device info structure. More...
 
int pcps_add_rsrc_io (PCPS_DDEV *pddev, MBG_IOPORT_ADDR_RAW base, ulong num)
 Add an I/O address range resource to the device structure. More...
 
int pcps_add_rsrc_mem (PCPS_DDEV *pddev, MBG_IOMEM_ADDR_RAW start, ulong len)
 Add a memory address range resource to the device structure. More...
 
int pcps_add_rsrc_irq (PCPS_DDEV *pddev, int16_t irq_num)
 Add an IRQ number resource to the device structure. More...
 
int pcps_setup_ddev (PCPS_DDEV *pddev, PCPS_BUS_FLAGS bus_mask, PCPS_DEV_ID dev_id)
 Initialize an allocated device structure for a specific device. More...
 
int pcps_chk_dev_feat (PCPS_DDEV *p_ddev, uint feat_type, uint feat_num)
 Check if a specific feature of a specific feature type is supported. More...
 
int pcps_probe_device (PCPS_DDEV *pddev, PCPS_BUS_NUM bus_num, PCPS_SLOT_NUM dev_fnc_num)
 Probe if a device is supported, and allocate and setup the device structure. More...
 
void pcps_cleanup_device (PCPS_DDEV *pddev)
 Clean up function called by pcps_probe_device on error. More...
 
int pcps_setup_and_start_pci_dev (PCPS_DDEV *pddev, PCPS_BUS_NUM bus_num, PCPS_SLOT_NUM dev_fnc_num)
 Setup and start a PCI device in a non-PnP system. More...
 
void pcps_detect_pci_devices (PCPS_DDEV_INIT_FNC *ddev_init_fnc, PCPS_DDEV_CLEANUP_FNC *ddev_cleanup_fnc, ushort vendor_id, PCPS_DEV_TYPE dev_type[], int n_dev_types)
 Detect and initialize PCI devices in a non-PnP system. More...
 
void pcps_detect_isa_devices (PCPS_DDEV_INIT_FNC *ddev_init_fnc, PCPS_DDEV_CLEANUP_FNC *ddev_cleanup_fnc, PCPS_DDEV_REGISTER_FNC *ddev_register_fnc, int isa_ports[16], int isa_irqs[16])
 Detect and initialize ISA devices in a non-PnP system. More...
 
void pcps_detect_devices (int isa_ports[16], int isa_irqs[16])
 Detect all bus-level devices in a non-PnP system. More...
 

Variables

const char driver_name []
 
int debug
 
PCPS_DEV_TYPE pcps_dev_type [N_PCPS_DEV_TYPE]
 
int pcps_isa_ports [16+1]
 
PCPS_DDEV pcps_ddev [16]
 
int n_ddevs
 
const char * fw_id_ref []
 The first characters of a valid firmware ID. More...
 
int force_io_access
 
int force_mm16_access
 

Macro Definition Documentation

◆ _DEFAULT_PCPS_USE_CLOCK_TICK

#define _DEFAULT_PCPS_USE_CLOCK_TICK   1

Definition at line 327 of file pcpsdrvr.h.

◆ _DEFAULT_PCPS_USE_ISA

#define _DEFAULT_PCPS_USE_ISA   defined( MBG_ARCH_X86 )

Definition at line 328 of file pcpsdrvr.h.

◆ _DEFAULT_PCPS_USE_ISA_PNP

#define _DEFAULT_PCPS_USE_ISA_PNP   0

Definition at line 331 of file pcpsdrvr.h.

◆ _DEFAULT_PCPS_USE_MCA

#define _DEFAULT_PCPS_USE_MCA   0

Definition at line 329 of file pcpsdrvr.h.

◆ _DEFAULT_PCPS_USE_MM_IO

#define _DEFAULT_PCPS_USE_MM_IO   ( MBG_TGT_SUPP_MEM_ACC && !MBG_USE_MM_IO_FOR_PCI )

Definition at line 543 of file pcpsdrvr.h.

◆ _DEFAULT_PCPS_USE_PCI

#define _DEFAULT_PCPS_USE_PCI   1

Definition at line 330 of file pcpsdrvr.h.

◆ _DEFAULT_PCPS_USE_PCI_PNP

#define _DEFAULT_PCPS_USE_PCI_PNP   _DEFAULT_MBG_TGT_LINUX_USE_PCI_PNP

Definition at line 332 of file pcpsdrvr.h.

◆ _DEFAULT_PCPS_USE_RSRCMGR

#define _DEFAULT_PCPS_USE_RSRCMGR   1

Definition at line 334 of file pcpsdrvr.h.

◆ _DEFAULT_PCPS_USE_USB

#define _DEFAULT_PCPS_USE_USB   _DEFAULT_MBG_TGT_LINUX_USE_USB

Definition at line 333 of file pcpsdrvr.h.

◆ _ext

#define _ext   extern

Definition at line 516 of file pcpsdrvr.h.

◆ _MBG_INIT_CODE_ATTR

#define _MBG_INIT_CODE_ATTR

Definition at line 410 of file pcpsdrvr.h.

◆ _pcps_ddev_access_mode_io

#define _pcps_ddev_access_mode_io (   _p)    ( (_p)->access_mode == PCPS_ACC_MODE_IO )

Definition at line 1210 of file pcpsdrvr.h.

Referenced by pcps_probe_device().

◆ _pcps_ddev_access_mode_mm

#define _pcps_ddev_access_mode_mm (   _p)
Value:
( ( (_p)->access_mode == PCPS_ACC_MODE_MM ) || \
( (_p)->access_mode == PCPS_ACC_MODE_MM16 ) )
32 bit memory mapped access
Definition: pcpsdrvr.h:916
16 bit memory mapped access
Definition: pcpsdrvr.h:917

Definition at line 1213 of file pcpsdrvr.h.

Referenced by _pcps_ddev_read_status_port(), and pcps_probe_device().

◆ _pcps_ddev_asic_version

#define _pcps_ddev_asic_version (   _p)    ( (_p)->asic_version )

Definition at line 1190 of file pcpsdrvr.h.

Referenced by pcps_check_pex_irq_unsafe(), and pcps_probe_device().

◆ _pcps_ddev_bus_flags

#define _pcps_ddev_bus_flags (   _p)    _pcps_bus_flags( &(_p)->dev )

Definition at line 1134 of file pcpsdrvr.h.

Referenced by get_bus_type_str(), and pcps_probe_device().

◆ _pcps_ddev_bus_num

#define _pcps_ddev_bus_num (   _p)    _pcps_bus_num( &(_p)->dev )

Definition at line 1167 of file pcpsdrvr.h.

Referenced by report_probe_device().

◆ _pcps_ddev_can_clr_ucap_buff

#define _pcps_ddev_can_clr_ucap_buff (   _p)    _pcps_can_clr_ucap_buff( &(_p)->dev )

Definition at line 1235 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_clr_ucap_buff().

◆ _pcps_ddev_can_set_time

#define _pcps_ddev_can_set_time (   _p)    _pcps_can_set_time( &(_p)->dev )

Definition at line 1220 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_set_time().

◆ _pcps_ddev_chk_err_flags

#define _pcps_ddev_chk_err_flags (   _p,
  _msk 
)    _pcps_chk_err_flags( &(_p)->dev, _msk )

Definition at line 1196 of file pcpsdrvr.h.

Referenced by pcps_probe_device().

◆ _pcps_ddev_clr_err_flags

#define _pcps_ddev_clr_err_flags (   _p,
  _msk 
)    _pcps_clr_err_flags( &(_p)->dev, _msk )

Definition at line 1202 of file pcpsdrvr.h.

◆ _pcps_ddev_dev_id

#define _pcps_ddev_dev_id (   _p)    _pcps_dev_id( &(_p)->dev )

◆ _pcps_ddev_err_flags

#define _pcps_ddev_err_flags (   _p)    _pcps_err_flags( &(_p)->dev )

Definition at line 1193 of file pcpsdrvr.h.

Referenced by pcps_probe_device().

◆ _pcps_ddev_features

#define _pcps_ddev_features (   _p)    _pcps_features( &(_p)->dev )

Definition at line 1184 of file pcpsdrvr.h.

Referenced by check_receiver_info_and_features(), and pcps_probe_device().

◆ _pcps_ddev_fw_has_20ms_bug

#define _pcps_ddev_fw_has_20ms_bug (   _p)    _pcps_fw_has_20ms_bug( &(_p)->dev )

Definition at line 1341 of file pcpsdrvr.h.

Referenced by report_access_mode().

◆ _pcps_ddev_fw_id

#define _pcps_ddev_fw_id (   _p)    _pcps_fw_id( &(_p)->dev )

◆ _pcps_ddev_fw_rev_num

#define _pcps_ddev_fw_rev_num (   _p)    _pcps_fw_rev_num( &(_p)->dev )

◆ _pcps_ddev_has_asic_features

#define _pcps_ddev_has_asic_features (   _p)    _pcps_has_asic_features( &(_p)->dev )

◆ _pcps_ddev_has_asic_version

#define _pcps_ddev_has_asic_version (   _p)    _pcps_has_asic_version( &(_p)->dev )

◆ _pcps_ddev_has_cab_len

#define _pcps_ddev_has_cab_len (   _p)    _pcps_has_cab_len( &(_p)->dev )

Definition at line 1227 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_gps_ant_cable_len(), and mbg_set_gps_ant_cable_len().

◆ _pcps_ddev_has_corr_info

#define _pcps_ddev_has_corr_info (   _p)    _pcps_has_corr_info( &(_p)->dev )

Definition at line 1308 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_get_corr_info().

◆ _pcps_ddev_has_debug_status

#define _pcps_ddev_has_debug_status (   _p)    _pcps_has_debug_status( &(_p)->dev )

Definition at line 1317 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_get_debug_status().

◆ _pcps_ddev_has_event_time

#define _pcps_ddev_has_event_time (   _p)    _pcps_has_event_time( &(_p)->dev )

Definition at line 1233 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_chk_dev_has_event_time(), and mbg_set_event_time().

◆ _pcps_ddev_has_evt_log

#define _pcps_ddev_has_evt_log (   _p)    _pcps_has_evt_log( &(_p)->dev )

◆ _pcps_ddev_has_fast_hr_timestamp

#define _pcps_ddev_has_fast_hr_timestamp (   _p)    _pcps_has_fast_hr_timestamp( &(_p)->dev )

Definition at line 1293 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_get_time_info_tstamp().

◆ _pcps_ddev_has_generic_io

#define _pcps_ddev_has_generic_io (   _p)    _pcps_has_generic_io( &(_p)->dev )

Definition at line 1278 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_generic_io().

◆ _pcps_ddev_has_gpio

#define _pcps_ddev_has_gpio (   _p)    _pcps_has_ri_gpio( _ri_addr( _p ) )

◆ _pcps_ddev_has_gps_data

#define _pcps_ddev_has_gps_data (   _p)    _pcps_has_gps_data( &(_p)->dev )

Definition at line 1272 of file pcpsdrvr.h.

Referenced by ioctl_switch().

◆ _pcps_ddev_has_gps_data_16

#define _pcps_ddev_has_gps_data_16 (   _p)    _pcps_has_gps_data_16( &(_p)->dev )

Definition at line 1269 of file pcpsdrvr.h.

Referenced by pcps_check_gps_data_size().

◆ _pcps_ddev_has_hr_time

#define _pcps_ddev_has_hr_time (   _p)    _pcps_has_hr_time( &(_p)->dev )

◆ _pcps_ddev_has_ident

#define _pcps_ddev_has_ident (   _p)    _pcps_has_ident( &(_p)->dev )

Definition at line 1223 of file pcpsdrvr.h.

Referenced by setup_sernum_and_receiver_info().

◆ _pcps_ddev_has_irig

#define _pcps_ddev_has_irig (   _p)    _pcps_has_irig( &(_p)->dev )

Definition at line 1251 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_chk_dev_has_irig().

◆ _pcps_ddev_has_irig_ctrl_bits

#define _pcps_ddev_has_irig_ctrl_bits (   _p)    _pcps_has_irig_ctrl_bits( &(_p)->dev )

Definition at line 1254 of file pcpsdrvr.h.

Referenced by ioctl_switch().

◆ _pcps_ddev_has_irig_time

#define _pcps_ddev_has_irig_time (   _p)    _pcps_has_irig_time( &(_p)->dev )

Definition at line 1257 of file pcpsdrvr.h.

Referenced by ioctl_switch().

◆ _pcps_ddev_has_irig_tx

#define _pcps_ddev_has_irig_tx (   _p)    _pcps_has_irig_tx( &(_p)->dev )

Definition at line 1237 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_irig_tx_info(), and mbg_set_irig_tx_settings().

◆ _pcps_ddev_has_lan_intf

#define _pcps_ddev_has_lan_intf (   _p)    _pcps_has_lan_intf( &(_p)->dev )

◆ _pcps_ddev_has_mod

#define _pcps_ddev_has_mod (   _p)    _pcps_has_mod( &(_p)->dev )

Definition at line 1248 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_chk_dev_has_mod().

◆ _pcps_ddev_has_opt_flags

#define _pcps_ddev_has_opt_flags (   _p)    _pcps_has_opt_flags( &(_p)->dev )

Definition at line 1266 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_opt_info(), and mbg_set_opt_settings().

◆ _pcps_ddev_has_pcps_tzdl

#define _pcps_ddev_has_pcps_tzdl (   _p)    _pcps_has_pcps_tzdl( &(_p)->dev )

Definition at line 1229 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_pcps_tzdl(), and mbg_set_pcps_tzdl().

◆ _pcps_ddev_has_ptp

#define _pcps_ddev_has_ptp (   _p)    _pcps_has_ptp( &(_p)->dev )

◆ _pcps_ddev_has_ptp_unicast

#define _pcps_ddev_has_ptp_unicast (   _p)    _pcps_has_ri_ptp_unicast( _ri_addr( _p ) )

◆ _pcps_ddev_has_pzf

#define _pcps_ddev_has_pzf (   _p)    _pcps_has_pzf( &(_p)->dev )

Definition at line 1305 of file pcpsdrvr.h.

Referenced by ioctl_switch().

◆ _pcps_ddev_has_raw_irig_data

#define _pcps_ddev_has_raw_irig_data (   _p)    _pcps_has_raw_irig_data( &(_p)->dev )

Definition at line 1260 of file pcpsdrvr.h.

Referenced by ioctl_switch().

◆ _pcps_ddev_has_receiver_info

◆ _pcps_ddev_has_ref_offs

#define _pcps_ddev_has_ref_offs (   _p)    _pcps_has_ref_offs( &(_p)->dev )

Definition at line 1263 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_ref_offs(), and mbg_set_ref_offs().

◆ _pcps_ddev_has_serial

#define _pcps_ddev_has_serial (   _p)    _pcps_has_serial( &(_p)->dev )

Definition at line 1221 of file pcpsdrvr.h.

◆ _pcps_ddev_has_serial_hs

#define _pcps_ddev_has_serial_hs (   _p)    _pcps_has_serial_hs( &(_p)->dev )

Definition at line 1241 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_chk_dev_has_serial_hs().

◆ _pcps_ddev_has_sernum

#define _pcps_ddev_has_sernum (   _p)    _pcps_has_sernum( &(_p)->dev )

Definition at line 1226 of file pcpsdrvr.h.

Referenced by setup_sernum_and_receiver_info().

◆ _pcps_ddev_has_signal

#define _pcps_ddev_has_signal (   _p)    _pcps_has_signal( &(_p)->dev )

Definition at line 1245 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_chk_dev_has_signal().

◆ _pcps_ddev_has_stat_info

#define _pcps_ddev_has_stat_info (   _p)    _pcps_has_stat_info( &(_p)->dev )

Definition at line 1320 of file pcpsdrvr.h.

◆ _pcps_ddev_has_stat_info_mode

#define _pcps_ddev_has_stat_info_mode (   _p)    _pcps_has_stat_info_mode( &(_p)->dev ) \

Definition at line 1323 of file pcpsdrvr.h.

◆ _pcps_ddev_has_stat_info_svs

#define _pcps_ddev_has_stat_info_svs (   _p)    _pcps_has_stat_info_svs( &(_p)->dev ) \

Definition at line 1326 of file pcpsdrvr.h.

◆ _pcps_ddev_has_sync_time

#define _pcps_ddev_has_sync_time (   _p)    _pcps_has_sync_time( &(_p)->dev )

Definition at line 1222 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_get_sync_time().

◆ _pcps_ddev_has_synth

#define _pcps_ddev_has_synth (   _p)    _pcps_has_synth( &(_p)->dev )

Definition at line 1275 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_synth(), mbg_get_synth_state(), and mbg_set_synth().

◆ _pcps_ddev_has_time_scale

#define _pcps_ddev_has_time_scale (   _p)    _pcps_has_time_scale( &(_p)->dev )

Definition at line 1281 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_time_scale_info(), and mbg_set_time_scale_settings().

◆ _pcps_ddev_has_tr_distance

#define _pcps_ddev_has_tr_distance (   _p)    _pcps_has_tr_distance( &(_p)->dev )

Definition at line 1311 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_tr_distance(), and mbg_set_tr_distance().

◆ _pcps_ddev_has_tz

#define _pcps_ddev_has_tz (   _p)    _pcps_has_tz( &(_p)->dev )

Definition at line 1231 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbg_chk_dev_has_tz().

◆ _pcps_ddev_has_tzcode

#define _pcps_ddev_has_tzcode (   _p)    _pcps_has_tzcode( &(_p)->dev )

Definition at line 1230 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_tzcode(), and mbg_set_tzcode().

◆ _pcps_ddev_has_tzdl

#define _pcps_ddev_has_tzdl (   _p)    _pcps_has_tzdl( &(_p)->dev )

Definition at line 1228 of file pcpsdrvr.h.

Referenced by ioctl_switch().

◆ _pcps_ddev_has_ucap

#define _pcps_ddev_has_ucap (   _p)    _pcps_has_ucap( &(_p)->dev )

Definition at line 1236 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_ucap_entries(), and mbg_get_ucap_event().

◆ _pcps_ddev_has_utc_offs

#define _pcps_ddev_has_utc_offs (   _p)    _pcps_has_utc_offs( &(_p)->dev )

Definition at line 1224 of file pcpsdrvr.h.

◆ _pcps_ddev_has_utc_parm

#define _pcps_ddev_has_utc_parm (   _p)    _pcps_has_utc_parm( &(_p)->dev )

Definition at line 1284 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_utc_parm(), and mbg_set_utc_parm().

◆ _pcps_ddev_has_xmr

◆ _pcps_ddev_incoming_tfom_ignored

#define _pcps_ddev_incoming_tfom_ignored (   _p)    _pcps_incoming_tfom_ignored( &(_p)->dev )

Definition at line 1329 of file pcpsdrvr.h.

◆ _pcps_ddev_io_base_mapped

#define _pcps_ddev_io_base_mapped (   _p,
  _n 
)    ( _pcps_ddev_io_rsrc( _p, _n ).base_mapped )

◆ _pcps_ddev_io_base_raw

#define _pcps_ddev_io_base_raw (   _p,
  _n 
)    ( _pcps_ddev_io_rsrc( _p, _n ).base_raw )

Definition at line 1176 of file pcpsdrvr.h.

Referenced by pcps_probe_device(), and report_access_mode().

◆ _pcps_ddev_io_rsrc

#define _pcps_ddev_io_rsrc (   _p,
  _n 
)    ( (_p)->rsrc_info.port[_n] )

Definition at line 1175 of file pcpsdrvr.h.

Referenced by pcps_release_rsrcs().

◆ _pcps_ddev_irq_num

#define _pcps_ddev_irq_num (   _p)    _pcps_irq_num( &(_p)->dev )

◆ _pcps_ddev_is_dcf

#define _pcps_ddev_is_dcf (   _p)    _pcps_is_dcf( &(_p)->dev )

Definition at line 1139 of file pcpsdrvr.h.

Referenced by ioctl_switch().

◆ _pcps_ddev_is_frc

#define _pcps_ddev_is_frc (   _p)    _pcps_is_frc( &(_p)->dev )

Definition at line 1144 of file pcpsdrvr.h.

◆ _pcps_ddev_is_gnss

#define _pcps_ddev_is_gnss (   _p)    _pcps_is_gnss( &(_p)->dev )

◆ _pcps_ddev_is_gps

#define _pcps_ddev_is_gps (   _p)    _pcps_is_gps( &(_p)->dev )

Definition at line 1138 of file pcpsdrvr.h.

Referenced by ioctl_switch(), pcps_release_rsrcs(), and setup_sernum_and_receiver_info().

◆ _pcps_ddev_is_irig_rx

#define _pcps_ddev_is_irig_rx (   _p)    _pcps_is_irig_rx( &(_p)->dev )

◆ _pcps_ddev_is_isa

#define _pcps_ddev_is_isa (   _p)    _pcps_is_isa( &(_p)->dev )

Definition at line 1151 of file pcpsdrvr.h.

Referenced by mbgdrvr_enable_cyclic(), and pcps_probe_device().

◆ _pcps_ddev_is_lwr

#define _pcps_ddev_is_lwr (   _p)    _pcps_is_lwr( &(_p)->dev )

Definition at line 1146 of file pcpsdrvr.h.

Referenced by ioctl_switch().

◆ _pcps_ddev_is_mca

#define _pcps_ddev_is_mca (   _p)    _pcps_is_mca( &(_p)->dev )

Definition at line 1152 of file pcpsdrvr.h.

Referenced by pcps_release_rsrcs().

◆ _pcps_ddev_is_msf

#define _pcps_ddev_is_msf (   _p)    _pcps_is_msf( &(_p)->dev )

Definition at line 1140 of file pcpsdrvr.h.

Referenced by ioctl_switch().

◆ _pcps_ddev_is_pci

#define _pcps_ddev_is_pci (   _p)    _pcps_is_pci( &(_p)->dev )

Definition at line 1153 of file pcpsdrvr.h.

Referenced by pcps_ddev_is_ptp270pex(), pcps_release_rsrcs(), and report_probe_device().

◆ _pcps_ddev_is_pci_amcc

#define _pcps_ddev_is_pci_amcc (   _p)    _pcps_is_pci_amcc( &(_p)->dev )

Definition at line 1160 of file pcpsdrvr.h.

Referenced by pcps_probe_device().

◆ _pcps_ddev_is_pci_asic

#define _pcps_ddev_is_pci_asic (   _p)    _pcps_is_pci_asic( &(_p)->dev )

Definition at line 1161 of file pcpsdrvr.h.

Referenced by pcps_probe_device().

◆ _pcps_ddev_is_pci_mbgpex

#define _pcps_ddev_is_pci_mbgpex (   _p)    _pcps_is_pci_mbgpex( &(_p)->dev )

Definition at line 1163 of file pcpsdrvr.h.

Referenced by pcps_probe_device(), and setup_mm_addr().

◆ _pcps_ddev_is_pci_pex8311

#define _pcps_ddev_is_pci_pex8311 (   _p)    _pcps_is_pci_pex8311( &(_p)->dev )

Definition at line 1162 of file pcpsdrvr.h.

Referenced by pcps_probe_device(), and setup_mm_addr().

◆ _pcps_ddev_is_pci_s5920

#define _pcps_ddev_is_pci_s5920 (   _p)    _pcps_is_pci_s5920( &(_p)->dev )

Definition at line 1159 of file pcpsdrvr.h.

Referenced by report_io_cmd().

◆ _pcps_ddev_is_pci_s5933

#define _pcps_ddev_is_pci_s5933 (   _p)    _pcps_is_pci_s5933( &(_p)->dev )

Definition at line 1158 of file pcpsdrvr.h.

◆ _pcps_ddev_is_ptp

#define _pcps_ddev_is_ptp (   _p)    _pcps_is_ptp( &(_p)->dev )

Definition at line 1143 of file pcpsdrvr.h.

Referenced by ioctl_switch().

◆ _pcps_ddev_is_usb

◆ _pcps_ddev_is_usb_v2

#define _pcps_ddev_is_usb_v2 (   _p)    _pcps_is_usb_v2( &(_p)->dev )

Definition at line 1157 of file pcpsdrvr.h.

◆ _pcps_ddev_is_wwvb

#define _pcps_ddev_is_wwvb (   _p)    _pcps_is_wwvb( &(_p)->dev )

Definition at line 1141 of file pcpsdrvr.h.

◆ _pcps_ddev_mem_rsrc

#define _pcps_ddev_mem_rsrc (   _p,
  _n 
)    ( (_p)->rsrc_info.mem[_n] )

Definition at line 1181 of file pcpsdrvr.h.

Referenced by pcps_release_rsrcs().

◆ _pcps_ddev_pci_cfg_err

#define _pcps_ddev_pci_cfg_err (   _p)    _pcps_pci_cfg_err( &(_p)->dev )

Definition at line 1332 of file pcpsdrvr.h.

Referenced by pcps_probe_device().

◆ _pcps_ddev_pci_fnc_num

#define _pcps_ddev_pci_fnc_num (   _p)    ( _pcps_ddev_slot_num( _p ) & 0x07 )

Definition at line 1170 of file pcpsdrvr.h.

Referenced by report_probe_device().

◆ _pcps_ddev_pci_slot_num

#define _pcps_ddev_pci_slot_num (   _p)    ( _pcps_ddev_slot_num( _p ) >> 3 )

Definition at line 1169 of file pcpsdrvr.h.

Referenced by report_probe_device().

◆ _pcps_ddev_raw_asic_version

#define _pcps_ddev_raw_asic_version (   _p)    ( (_p)->raw_asic_version )

Definition at line 1189 of file pcpsdrvr.h.

◆ _pcps_ddev_ref_type

#define _pcps_ddev_ref_type (   _p)    _pcps_ref_type( &(_p)->dev )

Definition at line 1133 of file pcpsdrvr.h.

Referenced by pcps_chk_dev_feat().

◆ _pcps_ddev_requires_irig_workaround

#define _pcps_ddev_requires_irig_workaround (   _d)
Value:
#define _pcps_ddev_type_num(_p)
Definition: pcpsdrvr.h:1130
#define _pcps_ddev_fw_rev_num(_p)
Definition: pcpsdrvr.h:1183
#define REV_HAS_GPS_DATA_16_GPS169PCI
Definition: pcpsdev.h:985

Definition at line 1463 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbg_get_irig_tx_info(), and mbg_set_irig_tx_settings().

◆ _pcps_ddev_sernum

◆ _pcps_ddev_sernum_size

#define _pcps_ddev_sernum_size (   _p)    sizeof( (_p)->dev.cfg.sernum )

Definition at line 1187 of file pcpsdrvr.h.

Referenced by setup_sernum_and_receiver_info().

◆ _pcps_ddev_set_err_flags

#define _pcps_ddev_set_err_flags (   _p,
  _msk 
)    _pcps_set_err_flags( &(_p)->dev, _msk )

◆ _pcps_ddev_short_port_base

#define _pcps_ddev_short_port_base (   _p,
  _n 
)    _pcps_short_port_base( &(_p)->dev, _n )

Definition at line 1173 of file pcpsdrvr.h.

Referenced by pcps_probe_device().

◆ _pcps_ddev_short_port_rsrc

#define _pcps_ddev_short_port_rsrc (   _p,
  _n 
)    _pcps_short_port_rsrc( &(_p)->dev, _n )

Definition at line 1172 of file pcpsdrvr.h.

◆ _pcps_ddev_slot_num

#define _pcps_ddev_slot_num (   _p)    _pcps_slot_num( &(_p)->dev )

Definition at line 1168 of file pcpsdrvr.h.

Referenced by report_probe_device().

◆ _pcps_ddev_status_busy

#define _pcps_ddev_status_busy (   _d)    ( _pcps_ddev_read_status_port( pddev ) & PCPS_ST_BUSY )

Definition at line 1455 of file pcpsdrvr.h.

Referenced by pcps_wait_busy().

◆ _pcps_ddev_timeout_clk

#define _pcps_ddev_timeout_clk (   _p)    _pcps_timeout_clk( &(_p)->dev )

Definition at line 1179 of file pcpsdrvr.h.

Referenced by pcps_wait_busy().

◆ _pcps_ddev_type_name

◆ _pcps_ddev_type_num

#define _pcps_ddev_type_num (   _p)    _pcps_type_num( &(_p)->dev )

Definition at line 1130 of file pcpsdrvr.h.

Referenced by pcps_probe_device().

◆ _pcps_force_reset

#define _pcps_force_reset (   _pddev)    _pcps_write_byte( (_pddev), PCPS_FORCE_RESET )

Definition at line 1417 of file pcpsdrvr.h.

◆ _pcps_kfree

#define _pcps_kfree (   _p,
  _sz 
)    kfree( _p )

Definition at line 556 of file pcpsdrvr.h.

Referenced by ddev_list_free(), ioctl_switch(), pcps_free_ddev_struc(), and report_ret_val().

◆ _pcps_kmalloc

#define _pcps_kmalloc (   _sz)    kmalloc( _sz, GFP_ATOMIC )

Definition at line 555 of file pcpsdrvr.h.

Referenced by ddev_list_alloc(), ioctl_switch(), pcps_alloc_ddev_struc(), and report_ret_val().

◆ _pcps_read

#define _pcps_read (   _pddev,
  _cmd,
  _p,
  _n 
)    ( (_pddev)->read( _pddev, (_cmd), (uchar FAR *)(_p), (_n) ) )

◆ _pcps_read_gps

#define _pcps_read_gps (   _pddev,
  _cmd,
  _p,
  _n 
)    pcps_read_gps( (_pddev), (_cmd), (uchar FAR *)(_p), (_n) )

Definition at line 1376 of file pcpsdrvr.h.

◆ _pcps_read_gps_var

#define _pcps_read_gps_var (   _pddev,
  _cmd,
  _s 
)    _pcps_read_gps( (_pddev), (_cmd), &(_s), sizeof( (_s) ) )

◆ _pcps_read_var

#define _pcps_read_var (   _pddev,
  _cmd,
  _s 
)    _pcps_read( (_pddev), (_cmd), &(_s), sizeof( (_s) ) )

◆ _pcps_sem_dec

#define _pcps_sem_dec (   _pddev)
Value:
atomic_dec( &(_pddev)->access_in_progress ); \
_mbg_mutex_release( &(_pddev)->dev_mutex )

Definition at line 575 of file pcpsdrvr.h.

Referenced by ioctl_switch(), mbgclock_default_clr_ucap_buff(), mbgclock_default_get_ucap_entries(), and mbgclock_default_get_ucap_event().

◆ _pcps_sem_inc

#define _pcps_sem_inc (   _pddev)
Value:
{ \
ulong flags; \
\
if ( _mbg_mutex_acquire( &(_pddev)->dev_mutex ) < 0 ) \
return -ERESTARTSYS; \
\
spin_lock_irqsave( &(_pddev)->irq_lock, flags ); \
atomic_inc( &(_pddev)->access_in_progress ); \
spin_unlock_irqrestore( &(_pddev)->irq_lock, flags ); \
}
#define _mbg_mutex_acquire(_pm)
Definition: mbgmutex.h:184

Definition at line 563 of file pcpsdrvr.h.

◆ _PCPS_STATIC_DEV_LIST

#define _PCPS_STATIC_DEV_LIST   ( !_PCPS_USE_PNP )

Definition at line 620 of file pcpsdrvr.h.

◆ _PCPS_USE_CLOCK_TICK

#define _PCPS_USE_CLOCK_TICK   _DEFAULT_PCPS_USE_CLOCK_TICK

Definition at line 365 of file pcpsdrvr.h.

◆ _PCPS_USE_ISA

#define _PCPS_USE_ISA   _DEFAULT_PCPS_USE_ISA

Definition at line 369 of file pcpsdrvr.h.

◆ _PCPS_USE_ISA_PNP

#define _PCPS_USE_ISA_PNP   _DEFAULT_PCPS_USE_ISA_PNP

Definition at line 381 of file pcpsdrvr.h.

◆ _PCPS_USE_MCA

#define _PCPS_USE_MCA   _DEFAULT_PCPS_USE_MCA

Definition at line 373 of file pcpsdrvr.h.

◆ _PCPS_USE_MM_IO

#define _PCPS_USE_MM_IO   _DEFAULT_PCPS_USE_MM_IO

Definition at line 546 of file pcpsdrvr.h.

◆ _PCPS_USE_PCI_BIOS

#define _PCPS_USE_PCI_BIOS   ( _PCPS_USE_PCI && !_PCPS_USE_PCI_PNP )

Definition at line 398 of file pcpsdrvr.h.

◆ _PCPS_USE_PCI_PNP

#define _PCPS_USE_PCI_PNP   _DEFAULT_PCPS_USE_PCI_PNP

Definition at line 385 of file pcpsdrvr.h.

◆ _PCPS_USE_PNP

#define _PCPS_USE_PNP   ( _PCPS_USE_PCI_PNP || _PCPS_USE_ISA_PNP || _PCPS_USE_USB )

Definition at line 401 of file pcpsdrvr.h.

◆ _PCPS_USE_RSRCMGR

#define _PCPS_USE_RSRCMGR   _DEFAULT_PCPS_USE_RSRCMGR

Definition at line 393 of file pcpsdrvr.h.

◆ _PCPS_USE_USB

#define _PCPS_USE_USB   _DEFAULT_PCPS_USE_USB

Definition at line 389 of file pcpsdrvr.h.

◆ _pcps_write

#define _pcps_write (   _pddev,
  _cmd,
  _p,
  _n 
)    pcps_write( (_pddev), (_cmd), (uchar FAR *)(_p), (_n) )

Definition at line 1366 of file pcpsdrvr.h.

◆ _pcps_write_byte

#define _pcps_write_byte (   _pddev,
  _b 
)    _pcps_read( (_pddev), (_b), NULL, 0 )

◆ _pcps_write_gps

#define _pcps_write_gps (   _pddev,
  _cmd,
  _p,
  _n 
)    pcps_write_gps( (_pddev), (_cmd), (uchar FAR *)(_p), (_n) )

Definition at line 1380 of file pcpsdrvr.h.

◆ _pcps_write_gps_var

#define _pcps_write_gps_var (   _pddev,
  _cmd,
  _s 
)    _pcps_write_gps( (_pddev), (_cmd), &(_s), sizeof( (_s) ) )

Definition at line 1410 of file pcpsdrvr.h.

◆ _pcps_write_var

#define _pcps_write_var (   _pddev,
  _cmd,
  _s 
)    _pcps_write( (_pddev), (_cmd), &(_s), sizeof( (_s) ) )

Definition at line 1397 of file pcpsdrvr.h.

◆ DEBUG_DEV_INIT

◆ DEBUG_DRVR

◆ DEBUG_IOCTL

#define DEBUG_IOCTL   0

Definition at line 426 of file pcpsdrvr.h.

Referenced by ioctl_switch(), and mbgdrvr_ioctl_emu_serial().

◆ DEBUG_USB_IO

#define DEBUG_USB_IO   0

Definition at line 422 of file pcpsdrvr.h.

◆ fw_id_ref_gps

#define fw_id_ref_gps   fw_id_ref[2]

Definition at line 1117 of file pcpsdrvr.h.

Referenced by pcps_probe_device().

◆ fw_id_ref_pcps

#define fw_id_ref_pcps   fw_id_ref[0]

Definition at line 1116 of file pcpsdrvr.h.

Referenced by pcps_probe_device().

◆ ISA_ID_PCPS

#define ISA_ID_PCPS   MCA_ID_PS31

A board ID for later ISA bus devices.

The number can be read at port_base + 2 (low byte), and port_base + 3 (high byte) of ISA devices. This ID number matches the MCA adapter ID MCA_ID_PS31 and is not provided by PC31 devices.

Definition at line 985 of file pcpsdrvr.h.

◆ MAX_PCPS_RSRC

#define MAX_PCPS_RSRC   ( N_PCPS_MEM_RSRC + N_PCPS_PORT_RSRC )

The max number of bus memory and I/O resources used by a device.

Definition at line 672 of file pcpsdrvr.h.

Referenced by pcps_cleanup_device().

◆ MBG_DRVR_NAME

#define MBG_DRVR_NAME   "mbgclock"

Definition at line 532 of file pcpsdrvr.h.

◆ MCA_ID_PS31

#define MCA_ID_PS31   0x6AAC

MCA adapter ID assigned by IBM.

Definition at line 961 of file pcpsdrvr.h.

◆ MCA_ID_PS31_OLD

#define MCA_ID_PS31_OLD   0x6303

MCA adapter ID assigned by Meinberg, used with the first series of PS31 boards.

Definition at line 962 of file pcpsdrvr.h.

◆ N_PCPS_MEM_RSRC

#define N_PCPS_MEM_RSRC   2

The max number of bus memory resources used by a device.

Definition at line 666 of file pcpsdrvr.h.

Referenced by pcps_add_rsrc_mem().

◆ PCPS_ACCESS_MODE_STR_FRCD

#define PCPS_ACCESS_MODE_STR_FRCD   " (forced)"

String to append if access mode has been forced.

See also
PCPS_ACCESS_MODE_STRS

Definition at line 943 of file pcpsdrvr.h.

Referenced by report_access_mode().

◆ PCPS_ACCESS_MODE_STRS

#define PCPS_ACCESS_MODE_STRS
Value:
{ \
"No real port I/O (dummy fnc)", \
"I/O via USB", \
"Standard port I/O", \
"Memory mapped I/O", \
"16 bit memory mapped I/O" \
}

Device access mode info strings.

See also
PCPS_ACCESS_MODES
PCPS_ACCESS_MODE_STR_FRCD

Definition at line 929 of file pcpsdrvr.h.

Referenced by report_access_mode().

◆ PCPS_DECODE_WIDTH_ISA

#define PCPS_DECODE_WIDTH_ISA   10

The number of address lines decoded by an ISA bus device.

Definition at line 1006 of file pcpsdrvr.h.

◆ PCPS_DECODE_WIDTH_MCA

#define PCPS_DECODE_WIDTH_MCA   16

The number of address lines decoded by an MCA device.

Definition at line 972 of file pcpsdrvr.h.

◆ PCPS_DECODE_WIDTH_PCI

#define PCPS_DECODE_WIDTH_PCI   16

The number of address lines decoded by a PCI clock.

Definition at line 950 of file pcpsdrvr.h.

◆ PCPS_DEFAULT_PORT

#define PCPS_DEFAULT_PORT   0x0300

The default port base address for ISA bus devices.

Some programs assume a default port for an ISA default, but others do not but require a cmd line parameter.

Definition at line 994 of file pcpsdrvr.h.

◆ PCPS_MAX_ISA_CARDS

#define PCPS_MAX_ISA_CARDS   N_SUPP_DEV_BUS

Definition at line 1071 of file pcpsdrvr.h.

Referenced by pcps_detect_isa_devices().

◆ PCPS_NUM_PORTS_ISA

#define PCPS_NUM_PORTS_ISA   4

The total number of I/O ports used by an ISA bus device.

Definition at line 1000 of file pcpsdrvr.h.

Referenced by pcps_detect_isa_devices().

◆ PCPS_NUM_PORTS_MCA

#define PCPS_NUM_PORTS_MCA   16

The total number of ports acquired by an MCA device.

Definition at line 967 of file pcpsdrvr.h.

Referenced by pcps_release_rsrcs().

◆ PCPS_TIMEOUT_CNT

#define PCPS_TIMEOUT_CNT   ( (ulong)( 200 * HZ ) / 1000 )

Definition at line 646 of file pcpsdrvr.h.

Referenced by pcps_probe_device().

◆ USE_LOCAL_IO_BUFFER

#define USE_LOCAL_IO_BUFFER   0

Definition at line 286 of file pcpsdrvr.h.

Typedef Documentation

◆ PCPS_DDEV

typedef struct PCPS_DDEV_s PCPS_DDEV

Definition at line 767 of file pcpsdrvr.h.

◆ PCPS_DDEV_CLEANUP_FNC

typedef void PCPS_DDEV_CLEANUP_FNC(PCPS_DDEV *pddev)

Definition at line 772 of file pcpsdrvr.h.

◆ PCPS_DDEV_INIT_FNC

typedef int PCPS_DDEV_INIT_FNC(PCPS_DDEV **ppddev)

Definition at line 771 of file pcpsdrvr.h.

◆ PCPS_DDEV_REGISTER_FNC

typedef int PCPS_DDEV_REGISTER_FNC(PCPS_DDEV *pddev)

Definition at line 773 of file pcpsdrvr.h.

◆ PCPS_READ_FNC

typedef int PCPS_READ_FNC(PCPS_DDEV *pddev, uint8_t cmd, void *buffer, uint16_t count)

Definition at line 769 of file pcpsdrvr.h.

◆ PCPS_WRITE_FNC

typedef int PCPS_WRITE_FNC(PCPS_DDEV *pddev, uint8_t cmd, const void *buffer, uint16_t count)

Definition at line 770 of file pcpsdrvr.h.

Enumeration Type Documentation

◆ PCPS_ACCESS_MODES

Codes used with PCPS_DDEV::access_mode.

See also
PCPS_ACCESS_MODE_STRS
PCPS_ACCESS_MODE_STR_FRCD
Enumerator
PCPS_ACC_MODE_NULL 

No real I/O, dummy routine used.

PCPS_ACC_MODE_USB 

USB I/O, no direct port access.

PCPS_ACC_MODE_IO 

Standard port I/O.

PCPS_ACC_MODE_MM 

32 bit memory mapped access

PCPS_ACC_MODE_MM16 

16 bit memory mapped access

N_PCPS_ACCESS_MODES 

Definition at line 911 of file pcpsdrvr.h.

Function Documentation

◆ _pcps_ddev_read_status_port()

static __mbg_inline uint8_t _pcps_ddev_read_status_port ( const PCPS_DDEV pddev)
static

◆ check_receiver_info_and_features()

◆ pcps_add_rsrc_io()

int pcps_add_rsrc_io ( PCPS_DDEV pddev,
MBG_IOPORT_ADDR_RAW  base,
ulong  num 
)

Add an I/O address range resource to the device structure.

Parameters
[in,out]pddevPointer to the device structure
[in]baseBase address of the I/O address range
[in]numNumber of addresses of the I/O address range
Returns
MBG_SUCCESS on success, else one of the MBG_ERROR_CODES

Definition at line 4897 of file pcpsdrvr.c.

References _mbg_kdd_msg_2, _mbg_kdd_msg_4, _pcps_ddev_set_err_flags, MBG_IOPORT_RSRC::base_mapped, MBG_IOPORT_RSRC::base_raw, MBG_ERR_RSRC_ITEM, MBG_LOG_ERR, MBG_LOG_INFO, mbg_map_ioport_rsrc(), mbg_rc_is_error, mbg_strerror(), MBG_SUCCESS, N_PCPS_PORT_RSRC, MBG_IOPORT_RSRC::num, PCPS_RSRC_INFO::num_rsrc_io, PCPS_EF_IO_RSRC_IO, PCPS_RSRC_INFO::port, rsrc_alloc_ports(), and PCPS_DDEV_s::rsrc_info.

Referenced by pcps_cleanup_device(), pcps_detect_isa_devices(), and pcps_release_rsrcs().

◆ pcps_add_rsrc_irq()

int pcps_add_rsrc_irq ( PCPS_DDEV pddev,
int16_t  irq_num 
)

◆ pcps_add_rsrc_mem()

int pcps_add_rsrc_mem ( PCPS_DDEV pddev,
MBG_IOMEM_ADDR_RAW  start,
ulong  len 
)

Add a memory address range resource to the device structure.

Parameters
[in,out]pddevPointer to the device structure
[in]startStart address of the memory range
[in]lenSize of the memory range
Returns
MBG_SUCCESS on success, else one of the MBG_ERROR_CODES

Definition at line 4959 of file pcpsdrvr.c.

References _mbg_kdd_msg_2, _mbg_kdd_msg_4, _pcps_ddev_set_err_flags, MBG_IOMEM_RSRC::len, MBG_ERR_RSRC_ITEM, MBG_LOG_ERR, MBG_LOG_INFO, mbg_map_iomem_rsrc(), mbg_rc_is_error, mbg_strerror(), MBG_SUCCESS, PCPS_RSRC_INFO::mem, N_PCPS_MEM_RSRC, PCPS_RSRC_INFO::num_rsrc_mem, PCPS_EF_IO_RSRC_MEM, rsrc_alloc_mem(), PCPS_DDEV_s::rsrc_info, MBG_IOMEM_RSRC::start_mapped, and MBG_IOMEM_RSRC::start_raw.

Referenced by pcps_cleanup_device().

◆ pcps_chk_dev_feat()

int pcps_chk_dev_feat ( PCPS_DDEV p_ddev,
uint  feat_type,
uint  feat_num 
)

Check if a specific feature of a specific feature type is supported.

There are different structures where information can be stored if a specific feature is supported. All information is set up when the pcps_probe_device function is called to probe and initialize the device. This generic low-level function can be called by API functions to check if a specific feature is supported.

Parameters
[in]p_ddevPointer to the device structure
[in]feat_typeSee DEV_FEAT_TYPES
[in]feat_numNumber and range depending on feat_type value
Returns
MBG_SUCCESS if the requested feature is supported, MBG_ERR_NOT_SUPP_BY_DEV if not supported, or one of the other MBG_ERROR_CODES
See also
pcps_probe_device

Definition at line 5112 of file pcpsdrvr.c.

References _check_feat_supp_bit, _mbg_kdd_msg_3, _mbgddmsg_4, _mbgddmsg_5, _pcps_ddev_ref_type, MBG_XFEATURE_BUFFER::b, MBG_TLV_FEAT_BUFFER::b, PCPS_DDEV_s::builtin_features, PCPS_DEV::cfg, check_feat_supp_byte_array(), DEBUG_DEV_INIT, PCPS_DDEV_s::dev, DEV_FEAT_TYPE_BUILTIN, DEV_FEAT_TYPE_PCPS, DEV_FEAT_TYPE_REF_TYPE, DEV_FEAT_TYPE_RI, DEV_FEAT_TYPE_TLV_FEAT, DEV_FEAT_TYPE_XFEAT, PCPS_DEV_CFG::features, RECEIVER_INFO::features, MBG_ERR_INV_PARM, MBG_ERR_NOT_SUPP_BY_DEV, MBG_ERR_NOT_SUPP_ON_OS, MBG_LOG_ERR, MBG_LOG_INFO, mbg_posix_errno_to_mbg(), mbg_rc_is_success, mbg_strerror(), MBG_SUCCESS, N_GPS_BUILTIN_FEATURE_BITS, N_GPS_FEATURE, N_MBG_TLV_FEAT_TYPES, N_MBG_XFEATURE, N_PCPS_FEATURE_BITS, N_PCPS_REF, MBG_XDEV_FEATURES::receiver_info, MBG_TLV_INFO::supp_tlv_feat, MBG_XDEV_FEATURES::tlv_info, PCPS_DDEV_s::xdev_features, and MBG_XDEV_FEATURES::xfeature_buffer.

Referenced by check_receiver_info_and_features(), do_chk_dev_feat(), and ioctl_switch().

◆ pcps_cleanup_ddev()

void pcps_cleanup_ddev ( PCPS_DDEV pddev)

Clean up and free a previously initialized device info structure.

Parameters
[in]pddevAddress of a device structure to be cleaned up and released
See also
pcps_init_ddev

Definition at line 4845 of file pcpsdrvr.c.

References _mbg_mutex_destroy, _mbgddmsg_fnc_entry, _mbgddmsg_fnc_exit, PCPS_DDEV_s::dev_mutex, and pcps_free_ddev_struc().

Referenced by mbgclock_init_module(), and pcps_detect_devices().

◆ pcps_cleanup_device()

◆ pcps_detect_devices()

void pcps_detect_devices ( int  isa_ports[16],
int  isa_irqs[16] 
)

Detect all bus-level devices in a non-PnP system.

Note
If a DOS TSR is installed, be sure it is disabled (BUSY flag set) when this function is called.
Parameters
[in]isa_portsAn array with potential I/O base addresses for ISA devices.
[in]isa_irqsAn array with potential IRQ numbers assigned to ISA devices.

◆ pcps_detect_isa_devices()

void pcps_detect_isa_devices ( PCPS_DDEV_INIT_FNC ddev_init_fnc,
PCPS_DDEV_CLEANUP_FNC ddev_cleanup_fnc,
PCPS_DDEV_REGISTER_FNC ddev_register_fnc,
int  isa_ports[16],
int  isa_irqs[16] 
)

Detect and initialize ISA devices in a non-PnP system.

Parameters
[in]ddev_init_fncPointer to function called to allocate a device structure for each detected device.
[in]ddev_cleanup_fncPointer to function called if the device structure needs to be de-allocated in case of error.
[in]ddev_register_fncPointer to function called to register a detected device.
[in]isa_portsAn array with potential I/O base addresses for ISA devices.
[in]isa_irqsAn array with potential IRQ numbers assigned to ISA devices.

◆ pcps_detect_pci_devices()

void pcps_detect_pci_devices ( PCPS_DDEV_INIT_FNC ddev_init_fnc,
PCPS_DDEV_CLEANUP_FNC ddev_cleanup_fnc,
ushort  vendor_id,
PCPS_DEV_TYPE  dev_type[],
int  n_dev_types 
)

Detect and initialize PCI devices in a non-PnP system.

Parameters
[in]ddev_init_fncPointer to function called to allocate a device structure for each detected device.
[in]ddev_cleanup_fncPointer to function called if the device structure needs to be de-allocated in case of error.
[in]vendor_idThe PCI vendor ID code.
[in]dev_typeAn array with known PCI devices for the specified vendor ID
[in]n_dev_typesThe number of entries in the PCI device table

Referenced by pcps_cleanup_device(), and pcps_detect_devices_init().

◆ pcps_dump_data()

void pcps_dump_data ( const void *  buffer,
size_t  count,
const char *  info 
)

◆ pcps_get_dev_type_table_entry()

PCPS_DEV_TYPE* pcps_get_dev_type_table_entry ( PCPS_BUS_FLAGS  bus_mask,
PCPS_DEV_ID  dev_id 
)

Lookup a specific device in the device table.

The function below takes a bus flag and device ID to search the table of known devices for a device which matches the given criteria.

Parameters
[in]bus_maskMask of the bus type to look up, see PCPS_BUS_FLAG_MASKS
[in]dev_idThe device ID to lookup, see MEINBERG_PCI_DEVICE_IDS or MBG_USB_DEVICE_IDS, depending on the bus_mask
Returns
A pointer to the device table entry, or NULL if no entry found

Definition at line 4672 of file pcpsdrvr.c.

References PCPS_DEV_TYPE::bus_flags, PCPS_DEV_TYPE::dev_id, N_PCPS_DEV_TYPE, and pcps_dev_type.

Referenced by pcps_add_rsrc_irq().

◆ pcps_init_ddev()

int pcps_init_ddev ( PCPS_DDEV **  ppddev)

Allocate and initialize a device info structure.

On success, the pointer to the device structure is set to the device structure, and the device structure has been initialized.

Parameters
[in,out]ppddevAddress of a pointer to a device structure to be allocated and initialized
Returns
MBG_SUCCESS on success, or MBG_ERR_NO_MEM if no memory could be allocated
See also
pcps_cleanup_ddev

Definition at line 4799 of file pcpsdrvr.c.

References _mbg_mutex_init, _mbg_spin_lock_init, _mbgddmsg_fnc_entry, _mbgddmsg_fnc_exit_chk_mbg_rc, PCPS_DDEV_s::dev_mutex, MBG_DRVR_NAME, mbg_rc_is_success, and pcps_alloc_ddev_struc().

Referenced by mbgclock_init_module(), and pcps_detect_devices().

◆ pcps_probe_device()

int pcps_probe_device ( PCPS_DDEV pddev,
PCPS_BUS_NUM  bus_num,
PCPS_SLOT_NUM  dev_fnc_num 
)

Probe if a device is supported, and allocate and setup the device structure.

This function should be called by the probe routine of any target-specific kernel driver. If the device is supported then all specific information including supported features is read from the device and stored in sub-structures of the device structure addressed by pdev.

Parameters
[in,out]pddevPointer to the device structure which has been initialized and will be set up
[in]bus_numThe bus number if supported (e.g. PCI), else 0
[in]dev_fnc_numThe device/function number if supported (e.g. PCI), else 0
Returns
MBG_SUCCESS if the requested feature is supported, MBG_ERR_NOT_SUPP_BY_DEV if not supported, or one of the other MBG_ERROR_CODES
See also
pcps_cleanup_device
pcps_chk_dev_feat

Definition at line 5409 of file pcpsdrvr.c.

References _convert_asic_version_number, _mbg_inp16_to_cpu, _mbg_inp32_to_cpu, _mbg_kdd_msg_0, _mbg_kdd_msg_1, _mbg_kdd_msg_2, _mbg_kdd_msg_3, _mbg_kdd_msg_4, _mbg_mmrd32_to_cpu, _mbg_mutex_init, _mbg_spin_lock_init, _mbgddmsg_1, _mbgddmsg_3, _mbgddmsg_fnc_entry, _pcps_asic_version_greater_equal, _pcps_asic_version_major, _pcps_ddev_access_mode_io, _pcps_ddev_access_mode_mm, _pcps_ddev_asic_version, _pcps_ddev_bus_flags, _pcps_ddev_chk_err_flags, _pcps_ddev_dev_id, _pcps_ddev_err_flags, _pcps_ddev_features, _pcps_ddev_fw_id, _pcps_ddev_fw_rev_num, _pcps_ddev_has_asic_features, _pcps_ddev_has_asic_version, _pcps_ddev_io_base_mapped, _pcps_ddev_io_base_raw, _pcps_ddev_is_isa, _pcps_ddev_is_pci_amcc, _pcps_ddev_is_pci_asic, _pcps_ddev_is_pci_mbgpex, _pcps_ddev_is_pci_pex8311, _pcps_ddev_is_usb, _pcps_ddev_pci_cfg_err, _pcps_ddev_set_err_flags, _pcps_ddev_short_port_base, _pcps_ddev_type_name, _pcps_ddev_type_num, _pcps_read, AMCC_INT_ACK, AMCC_INT_ENB, AMCC_INT_FLAG, AMCC_INT_MASK, AMCC_OP_REG_IMB4, AMCC_OP_REG_INTCSR, AMCC_OP_REG_RANGE_S5920, AMCC_OP_REG_RANGE_S5933, PCPS_DDEV_s::asic_features, PCPS_DDEV_s::asic_version, MBG_IOPORT_RSRC::base_mapped, MBG_IOPORT_RSRC::base_raw, BUILTIN_FEAT_FRC511PEX, BUILTIN_FEAT_GLN180PEX, BUILTIN_FEAT_GNS181PEX, BUILTIN_FEAT_GPS167PC, BUILTIN_FEAT_GPS167PCI, BUILTIN_FEAT_GPS168PCI, BUILTIN_FEAT_GPS169PCI, BUILTIN_FEAT_GPS170PCI, BUILTIN_FEAT_GPS170PEX, BUILTIN_FEAT_GPS180AMC, BUILTIN_FEAT_GPS180PEX, BUILTIN_FEAT_PTP270PEX, BUILTIN_FEAT_PZF180PEX, BUILTIN_FEAT_TCR167PCI, BUILTIN_FEAT_TCR170PEX, BUILTIN_FEAT_TCR180PEX, BUILTIN_FEAT_TCR180USB, BUILTIN_FEAT_UNDEFINED, BUILTIN_FEAT_WWVB511, PCPS_DDEV_s::builtin_features, PCPS_DEV_CFG::bus_num, PCPS_DEV::cfg, check_feature(), check_receiver_info_and_features(), DEBUG_DEV_INIT, PCPS_DDEV_s::dev, PCPS_DEV_TYPE::dev_id, PCPS_DDEV_s::dev_mutex, PCI_ASIC::features, PCPS_DEV_CFG::features, force_io_access, force_mm16_access, PCPS_DEV_CFG::fw_id, fw_id_ref_gps, fw_id_ref_pcps, PCPS_DEV_CFG::fw_rev_num, PCPS_TIME::hour, PCPS_DDEV_s::io_buffer, PCPS_RSRC_INFO::irq, PCPS_DDEV_s::irq_ack_mask, PCPS_DDEV_s::irq_ack_port, PCPS_DDEV_s::irq_disb_mask, PCPS_DDEV_s::irq_enb_disb_port, PCPS_DDEV_s::irq_enb_mask, PCPS_DDEV_s::irq_flag_mask, PCPS_DDEV_s::irq_flag_port, PCPS_DEV_CFG::irq_num, MBG_DRVR_NAME, MBG_ERR_GENERIC, mbg_get_pc_cycles_frequency(), mbg_get_sys_uptime(), MBG_LOG_DEBUG, MBG_LOG_ERR, MBG_LOG_INFO, MBG_LOG_WARN, mbg_rc_is_error, mbg_rc_is_success, mbg_sleep_sec(), MBG_SUCCESS, PCPS_TIME::mday, PCPS_RSRC_INFO::mem, PCPS_TIME::min, PCPS_DDEV_s::mm_asic_addr, PCPS_TIME::month, N_PCPS_PORT_RSRC, MBG_IOPORT_RSRC::num, MBG_IRQ_RSRC::num, PCPS_RSRC_INFO::num_rsrc_io, PCPS_RSRC_INFO::num_rsrc_irq, PCPS_RSRC_INFO::num_rsrc_mem, PCPS_TIME::offs_utc, pc_cycles_frequency, PCI_ASIC_FIX_IRQ_MINOR_GPS170PEX, PCI_ASIC_FIX_IRQ_MINOR_PEX511, PCI_ASIC_FIX_IRQ_MINOR_TCR511PEX, PCI_ASIC_HAS_MM_IO, PCI_ASIC_HR_TIME_MINOR_PEX511, PCI_ASIC_MAJOR_GPS170PEX, PCI_ASIC_MAJOR_PCI_0, PCI_ASIC_MAJOR_PEX511, PCI_ASIC_MAJOR_TCR511PEX, PCI_ASIC_PCI_IRQF, PCPS_ACC_MODE_IO, PCPS_ACC_MODE_MM, PCPS_ACC_MODE_MM16, PCPS_ACC_MODE_NULL, PCPS_ACC_MODE_USB, PCPS_BUS_ISA, PCPS_BUS_MCA, PCPS_BUS_PCI_ASIC, PCPS_BUS_PCI_MBGPEX, PCPS_BUS_PCI_PEX8311, PCPS_BUS_PCI_S5920, PCPS_BUS_PCI_S5933, PCPS_BUS_USB, PCPS_BUS_USB_V2, PCPS_CAN_CLR_UCAP_BUFF, PCPS_CAN_SET_TIME, pcps_check_id(), pcps_check_pex_irq_unsafe(), pcps_cleanup_device(), pcps_ddev_is_ptp270pex(), pcps_dev_type, PCPS_EF_INV_FW_ID, PCPS_EF_IO_ENB, PCPS_EF_IO_INIT, PCPS_EF_TIMEOUT, PCPS_FEAT_DCF600USB, PCPS_FEAT_FRC511PEX, PCPS_FEAT_GLN180PEX, PCPS_FEAT_GNS181PEX, PCPS_FEAT_GPS167PC, PCPS_FEAT_GPS167PCI, PCPS_FEAT_GPS168PCI, PCPS_FEAT_GPS169PCI, PCPS_FEAT_GPS170PCI, PCPS_FEAT_GPS170PEX, PCPS_FEAT_GPS180AMC, PCPS_FEAT_GPS180PEX, PCPS_FEAT_MSF51USB, PCPS_FEAT_MSF600USB, PCPS_FEAT_PC31PS31, PCPS_FEAT_PC32, PCPS_FEAT_PCI32, PCPS_FEAT_PCI509, PCPS_FEAT_PCI510, PCPS_FEAT_PCI511, PCPS_FEAT_PEX511, PCPS_FEAT_PTP270PEX, PCPS_FEAT_PZF180PEX, PCPS_FEAT_TCR167PCI, PCPS_FEAT_TCR170PEX, PCPS_FEAT_TCR180PEX, PCPS_FEAT_TCR180USB, PCPS_FEAT_TCR510PCI, PCPS_FEAT_TCR511PCI, PCPS_FEAT_TCR511PEX, PCPS_FEAT_TCR51USB, PCPS_FEAT_TCR600USB, PCPS_FEAT_USB5131, PCPS_FEAT_WVB600USB, PCPS_FEAT_WWVB51USB, pcps_get_fw_id(), pcps_get_rev_num(), PCPS_GIVE_TIME, PCPS_HAS_CABLE_LEN, PCPS_HAS_FAST_HR_TSTAMP, PCPS_HAS_GPS_DATA_16, PCPS_HAS_HR_TIME, PCPS_HAS_IRIG_CTRL_BITS, PCPS_HAS_IRIG_TIME, PCPS_HAS_RAW_IRIG_DATA, PCPS_HAS_SERIAL, PCPS_HAS_SYNC_TIME, PCPS_HAS_UCAP, PCPS_HAS_UTC_OFFS, pcps_read_amcc_s5920, pcps_read_amcc_s5933, pcps_read_asic, pcps_read_null, pcps_read_std, PCPS_IO_BUFFER::pcps_time, PCPS_TIMEOUT_CNT, PCPS_TYPE_DCF600USB, PCPS_TYPE_FRC511PEX, PCPS_TYPE_GLN180PEX, PCPS_TYPE_GNS181PEX, PCPS_TYPE_GPS167PC, PCPS_TYPE_GPS167PCI, PCPS_TYPE_GPS168PCI, PCPS_TYPE_GPS169PCI, PCPS_TYPE_GPS170PCI, PCPS_TYPE_GPS170PEX, PCPS_TYPE_GPS180AMC, PCPS_TYPE_GPS180PEX, PCPS_TYPE_MSF51USB, PCPS_TYPE_MSF600USB, PCPS_TYPE_PC31, PCPS_TYPE_PC32, PCPS_TYPE_PCI32, PCPS_TYPE_PCI509, PCPS_TYPE_PCI510, PCPS_TYPE_PCI511, PCPS_TYPE_PEX511, PCPS_TYPE_PS31, PCPS_TYPE_PS31_OLD, PCPS_TYPE_PTP270PEX, PCPS_TYPE_PZF180PEX, PCPS_TYPE_TCR167PCI, PCPS_TYPE_TCR170PEX, PCPS_TYPE_TCR180PEX, PCPS_TYPE_TCR180USB, PCPS_TYPE_TCR510PCI, PCPS_TYPE_TCR511PCI, PCPS_TYPE_TCR511PEX, PCPS_TYPE_TCR51USB, PCPS_TYPE_TCR600USB, PCPS_TYPE_USB5131, PCPS_TYPE_WVB600USB, PCPS_TYPE_WWVB51USB, PLX_LCS_INTCSR, PLX_LCS_INTCSR_INT_ENB, PLX_LCS_INTCSR_INT_FLAG, PCPS_DEV_CFG::port, PCPS_RSRC_INFO::port, PCPS_DDEV_s::raw_asic_version, PCI_ASIC::raw_version, report_access_mode(), report_probe_device(), REV_CAN_CLR_UCAP_BUFF_GPS167PCI, REV_CAN_CLR_UCAP_BUFF_GPS168PCI, REV_CAN_SET_TIME_PC31PS31, REV_HAS_CABLE_LEN_GPS167PC, REV_HAS_CABLE_LEN_GPS167PCI, REV_HAS_GPS_DATA_16_GPS169PCI, REV_HAS_HR_TIME_GPS167PC, REV_HAS_HR_TIME_PCI511, REV_HAS_HR_TIME_PEX511, REV_HAS_HR_TIME_TCR510PCI, REV_HAS_IRIG_CTRL_BITS_TCR511PCI, REV_HAS_IRIG_CTRL_BITS_TCR511PEX, REV_HAS_IRIG_CTRL_BITS_TCR51USB, REV_HAS_IRIG_TIME_TCR511PCI, REV_HAS_IRIG_TIME_TCR511PEX, REV_HAS_IRIG_TIME_TCR51USB, REV_HAS_IRQ_FIX_MINOR_GPS170PEX, REV_HAS_IRQ_FIX_MINOR_PEX511, REV_HAS_IRQ_FIX_MINOR_TCR511PEX, REV_HAS_RAW_IRIG_DATA_TCR511PCI, REV_HAS_RAW_IRIG_DATA_TCR511PEX, REV_HAS_RAW_IRIG_DATA_TCR51USB, REV_HAS_SERIAL_PC31PS31, REV_HAS_SYNC_TIME_PC31PS31, REV_HAS_UCAP_GPS167PCI, REV_HAS_UCAP_GPS168PCI, REV_HAS_UTC_OFFS_PC31PS31, PCPS_DDEV_s::rsrc_info, rsrc_port_to_cfg_port(), PCPS_TIME::sec, PCPS_TIME::sec100, set_access_mode(), setup_mm_addr(), setup_sernum_and_receiver_info(), PCPS_DEV_CFG::short_status_port, PCPS_TIME::signal, PCPS_DEV_CFG::slot_num, PCPS_TIME::status, PCPS_DDEV_s::status_port, PCPS_DDEV_s::status_port_offs, str_empty, PCPS_DEV_CFG::timeout_clk, PCPS_DEV::type, wait_ptp270pex_ready(), PCPS_TIME::wday, and PCPS_TIME::year.

Referenced by pcps_cleanup_device(), pcps_detect_isa_devices(), and pcps_release_rsrcs().

◆ pcps_release_rsrcs()

◆ pcps_setup_and_start_pci_dev()

int pcps_setup_and_start_pci_dev ( PCPS_DDEV pddev,
PCPS_BUS_NUM  bus_num,
PCPS_SLOT_NUM  dev_fnc_num 
)

Setup and start a PCI device in a non-PnP system.

Parameters
[in,out]pddevPointer to the device structure to be set up
[in]bus_numThe PCI bus number returned by the PCI BIOS
[in]dev_fnc_numThe PCI device/function number returned by the PCI BIOS

Referenced by pcps_cleanup_device().

◆ pcps_setup_ddev()

int pcps_setup_ddev ( PCPS_DDEV pddev,
PCPS_BUS_FLAGS  bus_mask,
PCPS_DEV_ID  dev_id 
)

Initialize an allocated device structure for a specific device.

Parameters
[in,out]pddevPointer to the device structure
[in]bus_maskMask of the bus type to look up, see PCPS_BUS_FLAG_MASKS
[in]dev_idThe device ID to lookup, see MEINBERG_PCI_DEVICE_IDS or MBG_USB_DEVICE_IDS, depending on the bus_mask
Returns
MBG_SUCCESS on success, else one of the MBG_ERROR_CODES

Referenced by pcps_add_rsrc_irq(), and pcps_cleanup_device().

◆ setup_sernum_and_receiver_info()

Variable Documentation

◆ debug

int debug

◆ driver_name

const char driver_name[]

◆ force_io_access

int force_io_access

◆ force_mm16_access

int force_mm16_access

◆ fw_id_ref

const char* fw_id_ref[]

The first characters of a valid firmware ID.

◆ n_ddevs

◆ pcps_ddev

◆ pcps_dev_type

◆ pcps_isa_ports

int pcps_isa_ports[ 16+1]

Referenced by mbg_find_devices().