rds.h

Go to the documentation of this file.
00001 /*** rds.h  --  Include File for Raw Data Server
00002 *
00003 *    Description:
00004 *
00005 *        This include file contains definitions, data structures and
00006 *        function prototypes for the Raw Data Server.
00007 *
00008 *****************************************************************************/
00009 
00010 #ifndef RDS_INCL
00011 #define RDS_INCL
00012 
00013 #define RDS_CONFIG_PATHNAME     "/usr/g/bin/rds_config.cfg"
00014 
00015 /* Debugging flags OR'd together into APS global rds_debug */
00016 #define RDS_DEBUG_FLOW1         0x0001  /* Detailed info of program flow */
00017 #define RDS_DEBUG_FLOW2         0x0002  /* "must have" info for program flow */
00018 #define RDS_DEBUG_INIT          0x0004
00019 #define RDS_DEBUG_SETUP         0x0008
00020 #define RDS_DEBUG_XFER1         0x0010
00021 #define RDS_DEBUG_XFER2         0x0020
00022 #define RDS_DEBUG_COMMS_AP      0x0040
00023 #define RDS_DEBUG_COMMS_HOST    0x0080
00024 #define RDS_DEBUG_ERRORS        0x0100
00025 #define RDS_DEBUG_WARNINGS      0x0200
00026 #define RDS_DEBUG_SOCKET        0x0400
00027 #define RDS_DEBUG_MCSOCK        0x0800
00028 #define RDS_DEBUG_FLOW3         0x1000  /* Overall info that will not kill drf */
00029 #define RDS_DEBUG_AQH_COMMS     0x2000
00030 #define RDS_DEBUG_SOCKTEST      0x4000
00031 #define RDS_DEBUG_DMA           0x8000  /* DMA from AP to APS memory */
00032 #define RDS_DEBUG_AQSOP1        0x10000 /* AQS non common opcode debug */
00033 #define RDS_DEBUG_AQSOP2        0x20000 /* AQS common (NEX) opcode debug */
00034 #define RDS_DEBUG_DATA1         0x40000
00035 #define RDS_DEBUG_DATA2         0x80000
00036 
00037 /* Size of APS buffer in bytes - start with 2Mb */
00038 #define RDS_APS_BUF_BYTES   (2 * 1024*1024)
00039 
00040 /* Status return value from RDS */
00041 #define RDS_OK                          0       /* Good return status */
00042 #define RDS_NOT_CONNECTED               400     /* No host process connected */
00043 
00044 /* Opcodes in packets sent between RDS to host */
00045 #define OP_RDS_RAW_READY        1
00046 #define OP_RDS_INIT             2
00047 #define OP_RDS_PREPPED          3
00048 
00049 
00050 #define RDS_XFER_DMA    1
00051 #define RDS_XFER_PUSH   2
00052 
00053 /* Data shared between RDS transfer and RDS socket tasks */
00054 
00055 typedef struct
00056 {
00057     int         connections;            /* RDS internal */
00058     int         host_socket_fd;         /* RDS internal */
00059     int         host_buff_offset;       /* RDS internal */
00060     int         views_per_xfer;         /* Rest of these loaded from host process init pkt */
00061    unsigned int aqs_pkt_flags;
00062     int         xfer_mode;
00063    unsigned int host_buff_addr;
00064     int         host_buff_size;
00065 } RDS_DATA_STRUCT;
00066 
00067 /* Messages passed between RDS tasks and the host process have the RDS_MESSAGE structure */
00068 /* which consists of a RDS_MSG_HDR header followed by a variable length packet */
00069 /* The size of the packet is given in the header. */
00070 
00071 #define RDS_MAX_MSG_BYTES 256
00072 
00073 typedef struct
00074 {
00075   int           opcode;         /* OP_RDS_INIT */
00076   int           pktlen;         /* bytes in this packet (excludes header) */
00077 } RDS_MSG_HDR;
00078 
00079 typedef struct
00080 {
00081   RDS_MSG_HDR hdr;
00082   char pkt[RDS_MAX_MSG_BYTES - sizeof(RDS_MSG_HDR)];
00083 } RDS_MESSAGE;
00084 
00085 /* From host to RDS with OP_RDS_INIT */
00086 /* Following connection to RDS_socket task */
00087 typedef struct
00088 {
00089   int           views_per_xfer; /* Views for AQS to accumulate before transfer */
00090   unsigned int  aqs_pkt_flags;  /* Enable bits for AQS packets */
00091   int           xfer_mode;      /* DMA and/or push/pull flags */
00092   unsigned int  host_buff_addr; /* If DMA-push: Target buffer start address */
00093   int           host_buff_size; /* If DMA-push: Target buffer size in bytes */
00094 } RDS_INIT_PKT;
00095 
00096 
00097 /* From RDS_transfer to host with OP_RDS_RAW_READY */
00098 /* Shows data is ready to be pulled or will be followed by data */
00099 typedef struct
00100 {
00101   unsigned int  id;             /* ID from AQS */
00102   int           timestamp;      /* APS timer3 timestamp */
00103   int           seq_num;        /* sequence number from RDS */
00104   unsigned int  raw_cs;         /* Checksum for raw data */
00105   unsigned int  msg_cs;         /* Checksum for AQS message data */
00106   int           raw_size;       /* Raw data section size in bytes */
00107   int           msg_size;       /* AQS message section size in bytes */
00108   unsigned int  aps_buff_addr;  /* PCI bus address of buffer */
00109   int           aps_buff_size;  /* size of APS buffer in bytes */
00110   int           start_offset;   /* Byte offset in buffer to start of this data */
00111   unsigned int  control_flags;  /* Bit settings */
00112 } RDS_RAW_READY_PKT;
00113 
00114 
00115 /* Bit masks for control_flags member of RDS_RAW_READY_PKT */
00116 #define RDS_DATA_SPLIT                  0x01
00117 #define RDS_DATA_SEND_VIEW_COUNT        0x02    /* View count was exceeded */
00118 #define RDS_DATA_SEND_EOP               0x04    /* End of pass was received */
00119 #define RDS_DATA_SEND_EOS               0x08    /* End of scan */
00120 #define RDS_DATA_SEND_NEWPATH           0x10    /* Datapath switched to Recon */
00121 #define RDS_DATA_SEND_MSG_LIST          0x20    /* Message list is full */
00122 
00123 typedef struct
00124 {
00125   unsigned int  timestamp;      /* APS timer3 timestamp */
00126   int           unused;
00127 } RDS_PREPPED_PKT;
00128 
00129 
00130 #endif

Generated on Wed Feb 28 15:18:49 2007 for NaviTrack by  doxygen 1.4.6