/** \file * gapg_user.h * * Created on: 05.08.2019, from mbspex example template * Author: J. Adamczewski-Musch * * Contains all common definitions for kernel driver and user space library */ #ifndef GAPG_USER_H_ #define GAPG_USER_H_ #include #define GAPGNAME "galapagos" #define GAPGNAMEFMT "galapagos%d" #define GAPG_VERSION "0.10" #define GAPG_AUTHORS "JAM " #define GAPG_DESC "GSI Arbitrary Logic And Pattern Generator System device driver" //#define GAPG_TRIX_RES 0 /**< Command for ioctl set trixor to reset trigger - clear dt flag */ //#define GAPG_TRIX_GO 1 /**< Command for ioctl set trixor to start acquisition */ //#define GAPG_TRIX_HALT 2 /**< Command for ioctl set trixor to stop acquisition */ //#define GAPG_TRIX_TIMESET 3 /**< Command for ioctl set trixor to set trigger time windows*/ //#define GAPG_TRIGGER_FIRED 0/**< return value from wait trigger to inform that trigger ir was fired reached */ //#define GAPG_TRIGGER_TIMEOUT 1 /**< return value from wait trigger to inform that wait timeout was reached */ //#define GAPG_SFP_NUMBER 4 /**< number of used sfp connections*/ #define GAPG_MAXCONFIG_VALS 60 /**< number of configuration commands treated by driver in a single operation*/ #define GAPG_REGISTERS_BAR 0 /**< base address region that contains the control register space */ struct gapg_reg_io { unsigned int address; /**< address of a board register, relative to the specified BAR*/ unsigned int value; /**< value for read/write at register address*/ unsigned char bar; /**< the BAR where the register is mapped to PCI access. */ }; //struct gapg_pipebuf { // unsigned long addr; /**< user space virtual address of mbs pipe*/ // unsigned long size; /**< allocated size or used size*/ //}; // // // //struct gapg_dma_io { // unsigned int source; /**< DMA source start address on the *gapg* pciEx board*/ // unsigned int target; /**< physical DMA target start address in host memory*/ // unsigned long virtdest; /**< virtual target start address in readout process. only for pipe type 4 with sg mapping*/ // unsigned int size; /**< size of bytes to transfer. returns real transfer size*/ // unsigned int burst; /**< burst lenght in bytes*/ //}; // //struct gapg_bus_io { // int sfp; /**< sfp link id 0..3 (-1 for broadcast to all configured sfps)*/ // long slave; /**< slave device id at the sfp (-1 ato broadcast to all slaves)*/ // unsigned long address; /**< address on the "field bus" connected to the optical links*/ // unsigned long value; /**< value for read/write at bus address. Contains result status after write*/ //}; // // //struct gapg_bus_config{ // struct gapg_bus_io param[GAPG_MAXCONFIG_VALS]; /**< array of configuration parameters*/ // unsigned int numpars; /**< number of used parameters*/ //}; // // //struct gapg_sfp_links{ // int numslaves[GAPG_SFP_NUMBER]; /**< contains configured number of slaves at each sfp chain. */ //}; // //struct gapg_token_io { // unsigned char sync; /**< 1:synchronous mode, 0: asynchronous mode*/ // unsigned char directdma; /**< 1: direct DMA to host on token receive, 0 explicit DMA from gapg ram required*/ // unsigned long sfp; /**< sfp link id 0..3 */ // unsigned long bufid; /**< switch double buffer id on slave (1 or 0)*/ // unsigned long dmatarget; /**< target address (physical) for DMA transfer*/ // unsigned long dmasize; /**< length of transferred data (bytes) after DMA*/ // unsigned long dmaburst; /**< burst size (bytes) for DMA*/ // unsigned long check_comm; /**< optional check returned command*/ // unsigned long check_token; /**< optional check returned token status bits*/ // unsigned long check_numslaves; /**< optional check returned number of slaves*/ //}; // // // //struct gapg_trixor_set { // unsigned int command; /**< command id to be issued for trixor*/ // unsigned int fct; /**< optional argument for trixor settings (fast clear time)*/ // unsigned int cvt; /**< optional argument for trixor settings (conversion time)*/ //}; /** the ioctl stuff here:*/ #define GAPG_IOC_MAGIC 0xE0 #define GAPG_IOC_RESET _IO( GAPG_IOC_MAGIC, 0) /**