libedt.h

Go to the documentation of this file.
00001 /* #pragma ident "@(#)libedt.h  1.302 04/03/08 EDT" */
00002 
00003 /* Copyright (c) 1995 by Engineering Design Team, Inc. */
00004 /* Copyright (c) 2011 by Engineering Design Team, Inc. */
00005 
00006 #ifndef INCLUDE_edtlib_h
00007 #define INCLUDE_edtlib_h
00008 
00014 #ifdef USB
00015 #include <usb.h>
00016 #endif
00017 
00229 #ifdef DOXYGEN_SHOW_UNDOC
00230 
00268 #endif
00269 
00270 
00271 #ifdef DOXYGEN_SHOW_UNDOC
00272 
00276 #endif
00277 #ifdef DOXYGEN_SHOW_UNDOC
00278  /* end dma_updown_internal group */
00279 #endif
00280 
00281 
00282 
00283 #ifdef DOXYGEN_SHOW_UNDOC
00284 
00288 #endif
00289 #ifdef DOXYGEN_SHOW_UNDOC
00290  /* end dma_fifo_internal group */
00291 #endif
00292 
00293 
00294 
00295 #ifdef DOXYGEN_SHOW_UNDOC
00296 
00300 #endif
00301 #ifdef DOXYGEN_SHOW_UNDOC
00302  /* end dma_inout_internal group */
00303 #endif
00304 
00305 
00306 
00307 #ifdef DOXYGEN_SHOW_UNDOC
00308 
00312 #endif
00313 #ifdef DOXYGEN_SHOW_UNDOC
00314  /* end dma_registers_internal group */
00315 #endif
00316 
00317 
00318 #ifdef DOXYGEN_SHOW_UNDOC
00319 
00323 #endif
00324 #ifdef DOXYGEN_SHOW_UNDOC
00325  /* end dma_utility_internal group */
00326 #endif
00327 
00328 
00329 
00330 #ifdef DOXYGEN_SHOW_UNDOC
00331 
00335 #endif
00336 #ifdef DOXYGEN_SHOW_UNDOC
00337  /* end dma_internal */
00338 #endif
00339 
00340 
00341 #define event_t HANDLE
00342 /*****************************************************
00343  * Kernel events                                     *
00344  *****************************************************/
00345 
00346 typedef char edt_version_string[128];
00347 
00348 /* undefined this to turn off event handling  */
00349 
00350 #define USE_EVENT_HANDLERS
00351 
00352 
00353 /* Event flags */
00354 /* These act as flag bits indicating our interest in these events */
00355 
00356 #define EDT_MAX_KERNEL_EVENTS           20
00357 #define EDT_BASE_EVENTS                 1
00358 
00359 #define EDT_EODMA_EVENT                 (EDT_BASE_EVENTS + 0)
00360 #define EDT_EODMA_EVENT_NAME            "edt_eodma"
00361 #define EV_EODMA                        EDT_EODMA_EVENT /* compat */
00362 
00363 #define EDT_EVENT_BUF                   (EDT_BASE_EVENTS + 1)
00364 #define EDT_BUF_EVENT_NAME              "edt_buf"
00365 
00366 #define EDT_EVENT_STAT                  (EDT_BASE_EVENTS + 2)
00367 #define EDT_STAT_EVENT_NAME             "edt_stat"
00368 
00369 #define EDT_EVENT_P16D_DINT             (EDT_BASE_EVENTS + 3)
00370 #define EDT_P16D_DINT_EVENT_NAME        "edt_p16dint"
00371 
00372 #define EDT_EVENT_P11W_ATTN             (EDT_BASE_EVENTS + 4)
00373 #define EDT_P11W_ATTN_EVENT_NAME        "edt_p11wattn"
00374 
00375 #define EDT_EVENT_P11W_CNT              (EDT_BASE_EVENTS + 5)
00376 #define EDT_P11W_CNT_EVENT_NAME         "edt_cnt"
00377 
00378 #define EDT_PDV_EVENT_ACQUIRE           (EDT_BASE_EVENTS + 6)
00379 #define EDT_EVENT_ACQUIRE               EDT_PDV_EVENT_ACQUIRE /* compat */
00380 #define EDT_PDV_ACQUIRE_EVENT_NAME      "edt_acquire"
00381 
00382 #define EDT_EVENT_PCD_STAT1             (EDT_BASE_EVENTS + 7)
00383 #define EDT_EVENT_PCD_STAT1_NAME        "edt_pcd_stat1"
00384 
00385 #define EDT_EVENT_PCD_STAT2             (EDT_BASE_EVENTS + 8)
00386 #define EDT_EVENT_PCD_STAT2_NAME        "edt_pcd_stat2"
00387 
00388 #define EDT_EVENT_PCD_STAT3             (EDT_BASE_EVENTS + 9)
00389 #define EDT_EVENT_PCD_STAT3_NAME        "edt_pcd_stat3"
00390 
00391 #define EDT_EVENT_PCD_STAT4             (EDT_BASE_EVENTS + 10)
00392 #define EDT_EVENT_PCD_STAT4_NAME        "edt_pcd_stat4"
00393 
00394 #define EDT_PDV_STROBE_EVENT            (EDT_BASE_EVENTS + 11)
00395 #define EDT_PDV_STROBE_EVENT_NAME       "edt_pdv_strobe"
00396 
00397 #define EDT_EVENT_P53B_SRQ              (EDT_BASE_EVENTS + 12)
00398 #define EDT_EVENT_P53B_SRQ_NAME         "edt_p53b_srq"
00399 
00400 #define EDT_EVENT_P53B_INTERVAL         (EDT_BASE_EVENTS + 13)
00401 #define EDT_EVENT_P53B_INTERVAL_NAME    "edt_p53b_interval"
00402 
00403 #define EDT_EVENT_P53B_MODECODE         (EDT_BASE_EVENTS + 14)
00404 #define EDT_EVENT_P53B_MODECODE_NAME    "edt_p53b_modecode"
00405 
00406 #define EDT_EVENT_P53B_DONE             (EDT_BASE_EVENTS + 15)
00407 #define EDT_EVENT_P53B_DONE_NAME        "edt_p53b_done"
00408 
00409 #define EDT_PDV_EVENT_FVAL              (EDT_BASE_EVENTS + 16)
00410 #define EDT_PDV_EVENT_FVAL_NAME         "edt_pdv_fval"
00411 
00412 #define EDT_PDV_EVENT_TRIGINT           (EDT_BASE_EVENTS + 17)
00413 #define EDT_PDV_EVENT_TRIGINT_NAME      "edt_pdv_trigint"
00414 
00415 #define EDT_EVENT_TEMP          (EDT_BASE_EVENTS + 18)
00416 #define EDT_EVENT_TEMP_NAME     "edt_temp_intr"
00417 
00418 #define EDT_MAX_EVENT_TYPES     (EDT_EVENT_TEMP + 1)
00419 
00420 /*
00421  * The EVENT_MODE controls the way the driver responds to events.
00422  * Mode 0 is similar to ACT_ONCE; mode 1 is similar to ACT_ALWAYS,
00423  * and mode 2 is similar to ACT_ALWAYS but disables the event
00424  * while user code is processing it to prevent OS lockups.
00425  */
00426 #define EDT_EVENT_MODE_MASK             0xFF000000
00427 #define EDT_EVENT_MODE_SHFT             24
00428 #define EDT_EVENT_MODE_ONCE             0
00429 #define EDT_EVENT_MODE_CONTINUOUS       1
00430 #define EDT_EVENT_MODE_SERIALIZE        2
00431 
00432 #if defined(WIN32) || defined(_NT_DRIVER_)
00433 typedef unsigned __int64 uint64_t ;
00434 typedef __int64 int64_t ;
00435 typedef unsigned int  uint32_t ;
00436 typedef int int32_t ;
00437 #endif
00438 
00439 /*
00440  * legal PCI proms for pciload and other prom detect code
00441  */
00442 #define PROM_UNKN       0
00443 #define AMD_4013E       1
00444 #define AMD_4013XLA     2
00445 #define AMD_4028XLA     3
00446 #define AMD_XC2S150     4
00447 #define AMD_XC2S200_4M  5
00448 #define AMD_XC2S200_8M  6
00449 #define AMD_XC2S100_8M  7
00450 #define AMD_XC2S300E    8
00451 #define SPI_XC3S1200E   9
00452 #define AMD_XC5VLX30T   10      /* WAS SPI_XC5VLX30T    */
00453 #define AMD_XC5VLX50T   11      /* WAS SPI_XC5VLX50T */
00454 #define AMD_EP2SGX30D   12
00455 #define AMD_XC5VLX70T   13
00456 
00457 /*
00458  * structure to set up phase locked loop parameters.
00459  * some of these values go into the AV9110-02 PLL chip
00460  * and others set up prescalars in the xilinx.
00461  */
00462 #ifdef USE_LONG_BUFCNT
00463 #if defined(_NT_) || defined(_NT_DRIVER_)
00464 typedef unsigned long long bufcnt_t ;
00465 #else
00466 typedef uint64_t bufcnt_t ;
00467 #endif
00468 #else
00469 typedef u_int bufcnt_t ;
00470 #endif
00471 
00472 typedef struct
00473 {
00474     int m; /* AV9110 refernce frequency divide range 3-127 */
00475     int n; /* AV9110 VCO feedback frequency divide range 3-127 */
00476     int v; /* AV9110 VCO feedback frequency prescalar range 1 or 8 */
00477     int r; /* AV9110 VCO output divider 1, 2, 4, 8 */
00478     int h; /* xilinx high speed divider (vco output) 1,3,5,7 */
00479     int l; /* xilinx divide by n 1-64 */
00480     int x; /* xilinx AV9110 prescale of 30MHz oscillator 1-256 */
00481 } edt_pll ;
00482 
00483 /*
00484  * Typedef for edt_bitpath to send and retrieve bitfile pathnames
00485  * from the driver.
00486  */
00487 typedef char edt_bitpath[128] ;
00488 
00489 /*
00490  * SBus Device struct
00491  */
00492 #define EDT_READ 0
00493 #define EDT_WRITE 1
00494 
00495 #ifndef TRUE
00496 
00497 #define TRUE 1
00498 #define FALSE 0
00499 
00500 #endif
00501 
00502 /* for edt_get_dma_info */
00503 typedef struct
00504 {
00505     uint_t      used_dma ;      /* dma started within current open/close */
00506     uint_t      alloc_dma ;     /* has allocated > 1 ring buffer */
00507     uint_t      active_dma ;    /* dma is currently active */
00508 } edt_dma_info ;
00509 
00510 /* defines for edt_set_kernel_buffers */
00511 #define EDT_USER_BUFS 0
00512 #define EDT_COPY_KBUFS 1
00513 #define EDT_MMAP_KBUFS  2
00514 #define EDT_PERSISTENT_KBUFS  4
00515 
00516 #define MAX_EXTENDED_WORDS 32
00517 typedef struct _EdtMezzDescriptor {
00518     int  id;
00519     int  n_extended_words;
00520     int  extended_rev;
00521     uint_t extended_data[MAX_EXTENDED_WORDS];
00522 } EdtMezzDescriptor;
00523 
00524 /*
00525  * embedded info
00526  */
00527 typedef struct {
00528     int clock; /* 4 */
00529     char sn[11];        
00530     char pn[11];
00531     char opt[11];
00532     int  rev; /* 4 */
00533     char ifx[11];
00534 } Edt_embinfo;
00535 
00536 typedef struct {
00537         char  fpga[32];                                 /* MUST match a pkg directory name */
00538         char  promdesc[32];                             /* description may include size */
00539         char  busdesc[8];                               /* PCI, PCIe, ... */
00540         int   xtype;                                    /* XTYPE_X, XTYPE_BT, XTYPE_LTX, XTYPE_SPI */
00541         int   magic;                                    /* magic code (not the magic # itself but a code */
00542         u_int sectorsize;                               /* sector size in bytes */
00543         u_int sectsperseg;                              /* sectors per segment */
00544         int   defaultseg;                               /* default unprotected segment */
00545         u_int (*id_addr)(void *, int);                  /* id address function pointer */
00546         int   load_seg0;                                /* 2d default unprotected segment (3v) */
00547         int   load_seg1;                                /* 2d default unprotected segment (5v) */
00548 #if 0 /* cool idea -- lets try to get this done, but filling in all the fields */
00549       /* will take some time and need lots of care, so commented out for now */
00550         struct sector_struct sector[16];                /* all sectors */
00551 #endif
00552 } Edt_prominfo ;
00553 
00554 #ifndef _KERNEL
00555 /* Event callback stuff */
00556 
00557 
00558 typedef void (*EdtEventFunc)(void *); 
00559 
00560 typedef struct edt_event_handler {
00561     struct edt_event_handler *next; /* in case we want linked lists */
00562     EdtEventFunc    callback;       /* function to call when event occurs */
00563     struct edt_device *owner;           /* reflexive pointer */
00564     uint_t          event_type;
00565     void *          data;               /* closure pointer for callback */    
00566     u_char          active;             /* flag for a graceful death */
00567     u_char          continuous;         /* flag for continuing events */
00568 #ifdef _NT_
00569     thread_t        wait_thread;        /* thread handle */
00570     event_t         wait_event;         /* kernel event handle */
00571     event_t         closing_event;      /* abort event handle */
00572     uint_t          thrdid;             /* thread id # */
00573 #elif defined(__sun)
00574     thread_t        thrdid ;            /* thread handle and ID in Solaris */
00575     sema_t                      sema_thread ;   /* thread sync semaphore */
00576 #elif defined(__linux__) 
00577 
00578   
00579     thread_t thrdid;
00580 #elif defined(__APPLE__)
00581     pthread_t thrdid ;
00582 
00583 #endif /* _NT_ */
00584 
00585 } EdtEventHandler;
00586 
00587 
00588 /* An EdtBdFilterFunction ("Bd" = Board) function is used by
00589  * edt_detect_boards_filter() to determine if a board with the given
00590  * dev (e.g. "pcd"), unit number, and bd_id (eg.. PCD_ID) should be 
00591  * included with the results of the board detection function. 
00592  * This is used, for example, by hubload.c to do a detect of only "ltx"
00593  * boards which are those matching a small number of bd_ids. 
00594  * The data parameter is passed to edt_detect_boards_filter, and 
00595  * subsequently passed on to the filter function; it can be either NULL
00596  * or any data which the filter function wants to help it do its job. 
00597  * Returns true for matches, false otherwise. */
00598 
00599 typedef int (*EdtBdFilterFunction) (char *dev, int unit, int bd_id, void *data);
00600 
00601 typedef struct {
00602     char type[8]; /* board family e.g., "pcd" */
00603     int id; /* board unit number */
00604     int bd_id; /* board id, e.g. PCD_ID */
00605 } Edt_bdinfo ;
00606 
00607 
00608 #define MAX_DMA_BUFFERS 1024
00609 
00610 typedef struct {
00611 
00612     int size;
00613 
00614     int allocated_size;
00615 
00616 
00617 #if defined(__sun)
00618 
00619     thread_t ring_tid;
00620 
00621 #endif
00622 
00623     char write_flag;
00624 
00625  
00626     char owned;
00627 
00628 } EdtRingBuffer;
00629 
00630 typedef struct _dma_data_block {
00631     u_int buffernum;
00632     u_char *pointer;
00633     u_int  offset;
00634     u_int  length;
00635 } EdtDMADataBlock;
00636 
00637 #define EDT_SS_TYPE 1
00638 #define EDT_GS_TYPE 2
00639 #define EDT_CD_TYPE 3
00640 #define EDT_LX_TYPE 4
00641 
00642 
00643 
00644 typedef struct _optionstr_fields {
00645    int  board_type;
00646     int  DMA_channels;
00647     char mezzanine_type[68];
00648     char filename[68];
00649     int  version_number;
00650     int  rev_number;
00651     char date[12];
00652     int  custom_DMA_channels;
00653     int  available_DMA_channels;
00654 } EdtOptionStringFields;
00655 
00656 typedef struct _EdtBitfileDescriptor {
00657     edt_bitpath bitfile_name;
00658     edt_bitpath mezz_name0;
00659     edt_bitpath mezz_name1;
00660     char optionstr[68];
00661     char mezz_optionstr0[32];
00662     char mezz_optionstr1[32];
00663 
00664     EdtOptionStringFields ostr;
00665 
00666     int  revision_register;
00667     int  string_type;
00668 
00669 } EdtBitfileDescriptor;
00670 
00671 typedef struct edt_device {
00672 #ifdef __APPLE__
00673     u_int               fd;
00674 #else
00675     HANDLE              fd ;           /* file descriptor of opened device     */
00676 #endif
00677     u_int               unit_no ;
00678     u_int               spi_reg_base ; /* Base address for SPI_ access registers (0 specifies default of 0x60) */
00679     uint_t              devid ;
00680     uint_t              devtype ;          /* 0 == PCI; 1 == USB; ... */
00681     uint_t              todo;          /* n buffers started            */
00682     uint_t              b_count;       /* per open byte counter for edt_read/write */
00683 
00684     /* flags for each ring buffer */
00685     EdtRingBuffer       rb_control[MAX_DMA_BUFFERS];
00686 
00687     /* addresses kept in own array for backward compatibility */
00688 
00689     unsigned char * ring_buffers[MAX_DMA_BUFFERS];
00690 
00691     unsigned char *     tmpbuf;          /* for interlace merging, etc. */
00692 
00693     uint_t              tmpbufsize;
00694 
00695     char                edt_devname[64] ;
00696     uint_t              cursample ;
00697     uint_t              minchunk ;
00698     bufcnt_t            donecount ;
00699     uint_t              nextwbuf ;     /* for edt_next_writebuf      */
00700 
00701     uint_t              ring_buffer_numbufs ;
00702     uint_t              ring_buffer_bufsize ;
00703     uint_t              ring_buffers_allocated ;
00704     uint_t              ring_buffers_configured ;
00705     uint_t              loops ;
00706     uint_t              ring_buffer_allocated_size ; /* if rounded up to page boundaries */
00707 
00708     uint_t              write_flag ;
00709 
00710     uint_t              foi_unit;
00711 
00712     uint_t              debug_level ;
00713     Dependent           *dd_p ;   /* device dependent struct        */
00714     void                *Pdma_p;  /* Pdma struct when Pdma used     */
00715 
00716     u_char *            data_end; /* end of base_buffer + 1 */
00717 
00718     /* For callback rountines */
00719 
00720     EdtEventHandler     event_funcs[EDT_MAX_KERNEL_EVENTS];
00721     u_int               use_RT_for_event_func ;
00722 
00723 
00724     u_int channel_no;
00725 
00726     /* Use this for allocating all ring-buffers in a single chunk (w/possible headers before or 
00727        after the ring-buffers). This is useful when trying to DMA into multiple ring-buffers which
00728        can be written/read as a block to a file*/
00729 
00730     unsigned char *     base_buffer;
00731 
00732     u_int               header_size;
00733     int                 header_offset;
00734 
00735     u_int               pending_samples; /* dma samples */
00736 
00737     int                 hubidx;
00738     volatile caddr_t    mapaddr;
00739 
00740     void *              pInterleaver; /* for post-processing data, such as deinterleaving image */
00741 
00742     unsigned char *output_base;
00743     unsigned char **output_buffers; /* for results from post-processing */
00744 
00745 #ifdef USB
00746     usb_dev_handle *usb_p ;
00747     int usb_bulk_read_endpoint ;
00748     int usb_bulk_write_endpoint ;
00749     int usb_rtimeout ;
00750     int usb_wtimeout ;
00751 #endif
00752 
00753     u_int buffer_granularity;
00754     u_int mmap_buffers;
00755     u_int totalsize;
00756     u_int               fullbufsize;
00757 
00758     /* low-latency dma routine fields
00759      * If we didn't need compatibility this could be a lot cleaner
00760     */
00761 
00762     EdtDMADataBlock     *blocks;
00763 
00764     double              last_buffer_time;
00765     double              next_sample;
00766     u_int               period;
00767      
00768     u_char *            last_sample_end;
00769 
00770     u_char              wait_mode;
00771     u_char              freerun;
00772 
00773     u_char              DMA_channels;
00774 
00775     EdtBitfileDescriptor bfd;
00776         EdtMezzDescriptor mezz;
00777 
00778     char                last_direction;
00779     u_char              last_wait_ret;
00780     u_int               promcode;
00781 
00782 
00783 } EdtDev;
00784 
00785 
00786 
00787 /* Function declarations for EdtDev */
00788 
00789 
00790 /* Header file for functions exported by libedt */
00791 
00796 EDTAPI EdtDev *        edt_open(char *device_name, int unit) ;
00797 EDTAPI EdtDev *        edt_open_quiet(char *device_name, int unit) ;
00798 EDTAPI EdtDev *        edt_open_channel(char *device_name, int unit, int channel) ;
00799 EDTAPI int             edt_close(EdtDev *edt_p) ;
00800  /* end updown group */
00802 
00806 EDTAPI int             edt_read(EdtDev *edt_p, void *buf, uint_t size) ;
00807 EDTAPI int             edt_write(EdtDev *edt_p, void *buf, uint_t size) ;
00808 
00809 EDTAPI int             edt_configure_ring_buffers(EdtDev *edt_p, int bufsize, 
00810                                                   int numbufs, int write_flag, 
00811                                                   unsigned char **bufarray) ;
00812 
00813 EDTAPI int             edt_configure_block_buffers_mem(EdtDev *edt_p, int bufsize, 
00814                                                        int numbufs, int write_flag, 
00815                                                        int header_size, int header_before,
00816                                                        u_char *user_mem);
00817 EDTAPI int             edt_configure_block_buffers(EdtDev *edt_p, int bufsize, 
00818                                                    int numbufs, int write_flag, 
00819                                                    int header_size, int header_before);
00820                                            
00821 
00822 EDTAPI int             edt_disable_ring_buffers(EdtDev *edt_p) ;
00823 
00824 EDTAPI int              edt_get_numbufs(EdtDev *edt_p);
00825 
00826 EDTAPI int                              edt_reset_ring_buffers(EdtDev *edt_p, uint_t bufnum);
00827 EDTAPI int                              edt_abort_dma(EdtDev *edt_p);
00828 EDTAPI int                              edt_abort_current_dma(EdtDev *edt_p);
00829 EDTAPI int                              edt_stop_buffers(EdtDev *edt_p);
00830 EDTAPI int                              edt_start_buffers(EdtDev *edt_p, uint_t count);
00831 
00832 
00833 EDTAPI int     edt_set_buffer_size(EdtDev *edt_p,
00834                                    uint_t which_buf,
00835                                    uint_t size,
00836                                    uint_t write_flag);
00837 
00838 EDTAPI unsigned int             edt_allocated_size(EdtDev *edt_p, int bufnum);
00839 EDTAPI int              edt_get_total_bufsize(EdtDev *edt_p,
00840                                               int bufsize, 
00841                                               int header_size);
00842 
00843 EDTAPI unsigned char   *edt_wait_for_buffers(EdtDev *edt_p, int count) ;
00844 
00845 
00846 EDTAPI int                 edt_ref_tmstamp(EdtDev *edt_p, u_int val) ;
00847 EDTAPI int                         edt_get_timestamp(EdtDev *edt_p, u_int *timep, u_int bufnum) ;
00848 EDTAPI int                         edt_get_reftime(EdtDev *edt_p, u_int *timep) ;
00849 EDTAPI unsigned char   *edt_wait_for_next_buffer(EdtDev *edt_p);
00850 EDTAPI unsigned char   *edt_last_buffer_timed(EdtDev *edt_p, u_int *timep) ;
00851 EDTAPI unsigned char   *edt_last_buffer(EdtDev *edt_p) ;
00852 EDTAPI unsigned char   *edt_wait_buffers_timed(EdtDev *edt_p, int count, u_int *timep);
00853 EDTAPI int             edt_set_buffer(EdtDev *edt_p, uint_t bufnum) ;
00854 EDTAPI unsigned char*  edt_next_writebuf(EdtDev    *edt_p) ;
00855 EDTAPI unsigned char** edt_buffer_addresses(EdtDev *edt_p) ;
00856 EDTAPI unsigned char * edt_get_current_dma_buf(EdtDev * edt_p);
00857 
00858 EDTAPI bufcnt_t        edt_done_count(EdtDev   *edt_p) ;
00859 EDTAPI unsigned char * edt_check_for_buffers(EdtDev *edt_p, uint_t count);
00860 
00861 EDTAPI uint_t                   edt_get_bytecount(EdtDev *edt_p) ;
00862 EDTAPI uint_t                   edt_get_timecount(EdtDev *edt_p) ;
00863 EDTAPI void                             edt_set_direction(EdtDev *edt_p, int direction) ;
00864 EDTAPI uint_t edt_get_timeout_count(EdtDev *edt_p);
00865 EDTAPI unsigned short  edt_get_direction(EdtDev *edt_p) ;
00866 
00867 EDTAPI void            edt_startdma_reg(EdtDev *edt_p, uint_t  desc, uint_t val) ;
00868 EDTAPI void            edt_enddma_reg(EdtDev *edt_p, uint_t    desc, uint_t val) ;
00869 EDTAPI void            edt_startdma_action(EdtDev *edt_p, uint_t   val) ;
00870 EDTAPI void            edt_enddma_action(EdtDev *edt_p, uint_t val) ;
00871 
00872 EDTAPI void edt_read_start_action(EdtDev * edt_p, u_int enable, u_int reg_desc,
00873                     u_char set, u_char clear, u_char setclear, u_char clearset, int delay1, int delay2);
00874 EDTAPI void edt_read_end_action(EdtDev * edt_p, u_int enable, u_int reg_desc,
00875                     u_char set, u_char clear, u_char setclear, u_char clearset, int delay1, int delay2);
00876 EDTAPI void edt_write_start_action(EdtDev * edt_p, u_int enable, u_int reg_desc,
00877                     u_char set, u_char clear, u_char setclear, u_char clearset, int delay1, int delay2);
00878 EDTAPI void edt_write_end_action(EdtDev * edt_p, u_int enable, u_int reg_desc,
00879                     u_char set, u_char clear, u_char setclear, u_char clearset, int delay1, int delay2);
00880 
00881 EDTAPI int                              edt_set_timeout_action(EdtDev *edt_p, u_int action);
00882 EDTAPI int                      edt_get_timeout_goodbits(EdtDev *edt_p);
00883 EDTAPI int                      edt_get_goodbits(EdtDev *edt_p);
00884 
00885 EDTAPI int                              edt_set_event_func(EdtDev *edt_p, int event_type, EdtEventFunc f, void *data, int continuous) ;
00886 EDTAPI int                              edt_remove_event_func(EdtDev *edt_p, int event_type) ;
00887 
00888 EDTAPI uint_t           edt_get_todo(EdtDev *edt_p) ;
00889 EDTAPI int             edt_ring_buffer_overrun(EdtDev *edt_p) ;
00890  /* end dma_inout */
00892 
00893 /* Internal or obsolete, etc. - we don't want to document these. */
00894 EDTAPI int             edt_configure_channel_ring_buffers(EdtDev *edt_p,
00895                                                           int bufsize, int numbufs, int write_flag,
00896                                                           unsigned char **bufarray) ;
00897 EDTAPI int                              edt_disable_ring_buffer(EdtDev *edt_p, 
00898                                                                 int nIndex);
00899 EDTAPI int             edt_cancel_current_dma(EdtDev *edt_p) ;
00900 EDTAPI int             edt_user_dma_wakeup(EdtDev *edt_p);
00901 EDTAPI int             edt_had_user_dma_wakeup(EdtDev *edt_p);
00902 
00906 EDTAPI uint_t          edt_reg_read(EdtDev *edt_p, uint_t desc) ;
00907 EDTAPI void            edt_reg_write(EdtDev *edt_p, uint_t desc, uint_t val) ;
00908 EDTAPI uint_t          edt_reg_or(EdtDev *edt_p, uint_t desc, uint_t val) ;
00909 EDTAPI uint_t          edt_reg_and(EdtDev *edt_p, uint_t desc, uint_t val) ;
00910 EDTAPI void          edt_reg_clearset(EdtDev *edt_p, uint_t desc, uint_t val) ;
00911 EDTAPI void          edt_reg_setclear(EdtDev *edt_p, uint_t desc, uint_t val) ;
00912 EDTAPI void            edt_intfc_write(EdtDev *edt_p, uint_t offset, uchar_t val) ;
00913 EDTAPI uchar_t         edt_intfc_read(EdtDev *edt_p, uint_t    offset) ;
00914 EDTAPI void            edt_intfc_write_short(EdtDev *edt_p, uint_t offset, u_short val) ;
00915 EDTAPI u_short         edt_intfc_read_short(EdtDev *edt_p, uint_t offset) ;
00916 EDTAPI void            edt_intfc_write_32(EdtDev   *edt_p, uint_t offset,  uint_t val) ;
00917 EDTAPI uint_t          edt_intfc_read_32(EdtDev *edt_p, uint_t offset) ;
00918  /* end dma_control */
00923 EDTAPI void                             edt_flush_fifo(EdtDev *edt_p) ;
00924 EDTAPI int                              edt_set_firstflush(EdtDev *edt_p, int val)      ;
00925 EDTAPI int                              edt_get_firstflush(EdtDev *edt_p) ;
00926 EDTAPI void             edt_flush_channel(EdtDev * edt_p, int channel) ;
00927  /* end dma_fifo */
00929 
00930 
00931 EDTAPI int             edt_get_wait_status(EdtDev *edt_p);
00932 EDTAPI int             edt_set_timeout_ok(EdtDev *edt_p, int val);
00933 EDTAPI int             edt_get_timeout_ok(EdtDev *edt_p);
00934 
00935 
00936 /* for a while it was called "eodma_sig" */
00937 EDTAPI void                             pcd_set_funct(EdtDev *edt_p, uchar_t val)       ;
00938 EDTAPI int                              edt_set_eodma_int(EdtDev *edt_p, int sig) ;
00939 EDTAPI int                              edt_set_autodir(EdtDev  *edt_p, int     val) ;
00940 
00941 
00942 EDTAPI int             edt_send_msg(EdtDev *edt_p, int unit, const char *msg, int size) ;
00943 EDTAPI int             edt_get_msg(EdtDev *edt_p, char *msgbuf, int maxsize) ;
00944 EDTAPI int             edt_get_msg_unit(EdtDev *edt_p, char *msgbuf, int maxsize, int unit) ;
00945 EDTAPI int             edt_serial_wait(EdtDev *edt_p, int size, int timeout) ;
00946 
00947 EDTAPI void            edt_send_dma(EdtDev *edt_p, int unit, uint_t    start_val) ;
00948 EDTAPI int             edt_wait_avail(EdtDev *edt_p) ;
00949 EDTAPI void            edt_init_mac8100(EdtDev *edt_p) ;
00950 EDTAPI u_short         edt_read_mac8100(EdtDev *edt_p, uint_t add) ;
00951 EDTAPI void            edt_write_mac8100(EdtDev *edt_p, uint_t add, u_short data) ;
00952 
00953 EDTAPI int             edt_get_dependent(EdtDev *edt_p, void *addr) ;
00954 EDTAPI int             edt_set_dependent(EdtDev *edt_p, void *addr) ;
00955 
00956 EDTAPI int             edt_flush_resp(EdtDev *edt_p) ;
00957 EDTAPI int             edt_get_tracebuf(EdtDev *edt_p, uint_t *addr)   ;
00958 EDTAPI int             edt_set_flush(EdtDev *edt_p, int val) ;
00962 EDTAPI int             edt_timeouts(EdtDev *edt_p) ; /* end dma_inout */
00964 
00965 
00966 EDTAPI void            edt_flush_mode(EdtDev *edt_p, uint_t    val) ;
00967 
00968 EDTAPI void            edt_check_foi(EdtDev *edt_p) ;
00969 EDTAPI void            edt_foi_autoconfig(EdtDev *edt_p) ;
00970 EDTAPI int             edt_set_foiunit(EdtDev *edt_p, int unit) ;
00971 EDTAPI int             edt_get_foiunit(EdtDev *edt_p) ;
00972 
00973 EDTAPI int             edt_set_rci_dma(EdtDev *edt_p, int unit, int channel) ;
00974 EDTAPI int             edt_get_rci_dma(EdtDev *edt_p, int unit) ;                       
00975 EDTAPI int             edt_set_rci_chan(EdtDev *edt_p, int unit, int channel) ;
00976 EDTAPI int             edt_get_rci_chan(EdtDev *edt_p, int unit) ;
00977 
00978 
00979 EDTAPI void            edt_reset_counts(EdtDev *edt_p) ;
00980 EDTAPI void            edt_reset_serial(EdtDev *edt_p) ;
00981 EDTAPI int             edt_set_foicount(EdtDev *edt_p, int count) ;
00982 EDTAPI int             edt_get_foicount(EdtDev *edt_p) ;
00983 
00984 
00985 EDTAPI int             edt_set_debug(EdtDev *edt_p, int count) ;
00986 EDTAPI int             edt_get_debug(EdtDev *edt_p) ;
00987 
00988 
00993 EDTAPI int             edt_set_burst_enable(EdtDev *edt_p, int on) ;
00994 EDTAPI int             edt_get_burst_enable(EdtDev *edt_p) ;
00995 
00996 EDTAPI int             edt_set_rtimeout(EdtDev *edt_p, int value) ;
00997 EDTAPI int             edt_set_wtimeout(EdtDev *edt_p, int value) ;
00998 
00999 EDTAPI int             edt_get_rtimeout(EdtDev *edt_p) ;
01000 EDTAPI int             edt_get_wtimeout(EdtDev *edt_p) ; /* end dma_inout */
01002 
01003 EDTAPI void            edt_set_out_clk(EdtDev *edt_p, edt_pll *clk_data) ;
01004 EDTAPI u_char          edt_set_funct_bit(EdtDev    *edt_p, u_char mask) ;
01005 EDTAPI u_char          edt_clr_funct_bit(EdtDev    *edt_p, u_char mask) ;
01006 EDTAPI u_char          edt_set_pllct_bit(EdtDev * edt_p, u_char mask);
01007 EDTAPI u_char          edt_clr_pllct_bit(EdtDev * edt_p, u_char mask);
01008 EDTAPI int             edt_set_ignore_signals(EdtDev *edt_p, int ignore);
01009 
01010 
01011 
01012 
01013 
01014 
01015 
01019 EDTAPI int             edt_device_id(EdtDev *edt_p);
01020 EDTAPI char *          edt_idstr(int id) ;
01021 EDTAPI int                         edt_access(char *fname, int perm) ;
01022 EDTAPI int                         edt_parse_unit(const char *str, char *dev, const char *default_dev) ;
01023 EDTAPI int                         edt_parse_unit_channel(const char *str, char *dev, 
01024                                                           const char *default_dev,
01025                                                           int *channel) ;
01026 EDTAPI int             edt_find_xpn(char *partnum, char *xilinx);
01027 EDTAPI uint_t          edt_overflow(EdtDev *edt_p) ;
01028 EDTAPI void            edt_perror(char *str) ;
01029 EDTAPI u_int           edt_errno(void) ;
01030 
01031 EDTAPI char *           edt_timestring(u_int *timep) ;
01032 EDTAPI int              edt_system(const char *cmdstr) ;
01033 EDTAPI int              edt_fix_millennium(char *str, int rollover);
01034 
01035 #if 1
01036 EDTAPI char             *edt_fmt_pn(char *pn, char *pn_str);
01037 EDTAPI int              edt_parse_esn(char *str, Edt_embinfo *ei);
01038 EDTAPI void             edt_get_sns(EdtDev *edt_p, char *esn, char *osn);
01039 EDTAPI void             edt_get_sns_sector(EdtDev *edt_p, char *esn, char *osn, int sector);
01040 EDTAPI void             edt_get_osn(EdtDev *edt_p, char *osn);
01041 EDTAPI void             edt_get_esn(EdtDev *edt_p, char *esn);
01042 #endif
01043 
01044 
01045 
01046 /* Subroutines to set driver last bitfile loaded; used in bitload */
01047 EDTAPI int             edt_set_bitpath(EdtDev *edt_p, const char *bitpath) ;
01048 EDTAPI int             edt_get_bitpath(EdtDev *edt_p, char *bitpath, int size) ;
01049 EDTAPI int             edt_get_bitname(EdtDev *edt_p, char *bitpath, int size) ;
01050 EDTAPI int             edt_set_mezz_chan_bitpath(EdtDev *edt_p, const char *bitpath, int channel) ;
01051 EDTAPI int             edt_get_mezz_chan_bitpath(EdtDev *edt_p, char *bitpath, int size, int channel) ;
01052 EDTAPI int             edt_set_mezz_bitpath(EdtDev *edt_p, const char *bitpath) ;
01053 EDTAPI int             edt_get_mezz_bitpath(EdtDev *edt_p, char *bitpath, int size) ;
01054 
01055 EDTAPI char *          edt_get_last_bitpath(EdtDev *edt_p);
01056 
01057 EDTAPI u_int           edt_get_full_board_id(EdtDev *edt_p,
01058                                                 int *extended_n,
01059                                                 int *rev_id,
01060                                                 u_int *extended_data);
01061 
01062 EDTAPI u_int           edt_get_board_id(EdtDev *edt_p);
01063 
01064 /* These two functions set/get mezz id info from driver, not board */
01065 
01066 EDTAPI u_int       edt_set_mezz_id(EdtDev *edt_p);
01067 EDTAPI u_int       edt_get_mezz_id(EdtDev *edt_p);
01068 
01069 
01070 EDTAPI int         edt_get_driver_version(EdtDev *edt_p, 
01071                                           char *versionstr,
01072                                           int size);
01073 
01074 EDTAPI int         edt_get_driver_buildid(EdtDev *edt_p, 
01075                                           char *build, 
01076                                           int size);
01077 
01078 EDTAPI int         edt_get_library_version(EdtDev *edt_p, 
01079                                            char *versionstr,
01080                                            int size);
01081 
01082 EDTAPI int         edt_get_library_buildid(EdtDev *edt_p, 
01083                                            char *build, 
01084                                            int size);
01085 
01086 EDTAPI int      edt_check_version(EdtDev *edt_p); 
01087 EDTAPI int      edt_get_kernel_event(EdtDev *edt_p, int event_num);
01088 EDTAPI u_int    edt_get_dma_info(EdtDev * edt_p, edt_dma_info *dmainfo);
01089  /* end dma_utility */
01091 
01092 EDTAPI int      edt_pci_reboot(EdtDev *edt_p); 
01093 EDTAPI int      edt_set_merge(EdtDev * edt_p, u_int size, int span, u_int offset, u_int count) ;
01094 
01095 EDTAPI void            edt_set_buffer_granularity(EdtDev *edt_p, 
01096                                                   u_int granularity);
01097 
01098 EDTAPI void            edt_reset_fifo(EdtDev *) ;
01099 
01100 EDTAPI u_int           edt_set_sgbuf(EdtDev *edt_p, u_int sgbuf, u_int bufsize, 
01101                                      u_int bufdir, u_int verbose) ;
01102 EDTAPI u_int           edt_set_sglist(EdtDev *edt_p, u_int bufnum, 
01103                                       u_int *log_list, u_int log_entrys) ;
01104 
01105 EDTAPI int                              edt_lockoff(EdtDev *edt_p) ;
01106 
01107 EDTAPI int             edt_enable_event(EdtDev *edt_p, int event_type) ;
01108 EDTAPI int             edt_reset_event_counter(EdtDev * edt_p, int event_type) ;
01109 EDTAPI int             edt_wait_event(EdtDev *edt_p, int event_type, 
01110                                       int timeoutval) ;
01111 EDTAPI void            edt_dmasync_fordev(EdtDev *edt, int bufnum, int offset,
01112                                           int bytecount) ;
01113 EDTAPI void            edt_dmasync_forcpu(EdtDev *edt, int bufnum, int offset,
01114                                           int bytecount) ;
01115 EDTAPI u_int           edt_get_bufbytecount(EdtDev * edt_p, u_int *cur_buffer) ;
01116 EDTAPI int             edt_little_endian(void) ;
01117 /* deal with a hardware timeout */
01122 EDTAPI int             edt_do_timeout(EdtDev *edt_p); /* end dma_inout */
01124 EDTAPI int             edt_set_continuous(EdtDev *edt_p, int on) ;
01125 EDTAPI void            edt_resume(EdtDev *edt_p) ;
01126 EDTAPI void            edt_set_timetype(EdtDev *edt_p, u_int type) ;
01127 EDTAPI caddr_t         edt_mapmem(EdtDev *edt_p, u_int addr, int size) ;
01128 EDTAPI u_int           edt_get_mappable_size(EdtDev *edt_p); /* get the size of the second address space */
01129 EDTAPI u_int           edt_get_drivertype(EdtDev *edt_p) ;
01130 EDTAPI int             edt_set_drivertype(EdtDev *edt_p, u_int type) ;
01131 EDTAPI void            edt_set_abortintr(EdtDev *edt_p, u_int val) ;
01132 
01133 EDTAPI int edt_write_pio(EdtDev *edt_p, u_char *buf, int size);
01134 
01135 EDTAPI int edt_set_max_buffers(EdtDev *edt_p, int newmax);
01136 EDTAPI int edt_get_max_buffers(EdtDev *edt_p);
01137 
01138 EDTAPI int edt_set_kernel_buffers(EdtDev *edt_p, int onoff);
01139 EDTAPI int edt_get_kernel_buffers(EdtDev *edt_p);
01140 EDTAPI int edt_set_persistent_buffers(EdtDev *edt_p, int onoff);
01141 EDTAPI int edt_get_persistent_buffers(EdtDev *edt_p);
01142 EDTAPI int edt_set_mmap_buffers(EdtDev *edt_p, int onoff);
01143 EDTAPI int edt_get_mmap_buffers(EdtDev *edt_p);
01144 
01145 EDTAPI int edt_get_kernel_alloc(EdtDev *edt_p, int pool);
01146 
01147 EDTAPI void edt_set_dump_reg_access(int on);
01148 
01149 #ifdef __sun
01150 EDTAPI void            edt_set_RT(u_int pri) ;
01151 EDTAPI int             edt_use_umem_lock(EdtDev *edt_p, u_int use_lock) ;
01152 EDTAPI int             edt_get_umem_lock(EdtDev *edt_p) ;
01153 #endif
01154 
01155 EDTAPI void   edt_x_byte_program(EdtDev *edt_p, u_int addr, u_char data, int isbt);
01156 EDTAPI void   edt_x_block_program(EdtDev *edt_p, u_int addr, u_char *data, int nbytes, int xtype);
01157 EDTAPI void   edt_x_verify(EdtDev *edt_p, u_int addr, u_char *data, int nbytes, int xtype);
01158 EDTAPI void   edt_x_reset(EdtDev * edt_p, int isbt);
01159 EDTAPI void   edt_x_print16(EdtDev * edt_p, u_int addr, int xtype);
01160 EDTAPI int    edt_x_prom_detect(EdtDev *edt_p, u_char *stat);
01161 EDTAPI Edt_prominfo *edt_get_prominfo(int promcode);
01162 EDTAPI int    edt_get_max_promcode();
01163 EDTAPI u_char edt_x_read(EdtDev * edt_p, u_int addr, int xtype);
01164 EDTAPI char * edt_x_type_string(int xtype);
01165 
01166 EDTAPI u_int edt_get_id_addr(int promcode, int segment);
01167 EDTAPI u_int edt_get_id_addrs(EdtDev *edt_p, int promcode, int segment, u_int *osn_addr, u_int *esn_addr);
01168 EDTAPI int edt_program_xilinx(EdtDev *edt_p, const u_char *buf, int size, int do_sleep);
01169 int edt_program_xilinx_start(EdtDev *edt_p);
01170 void edt_program_xilinx_chunk(EdtDev *edt_p, const u_char *buf, int xfer, int do_sleep);
01171 int edt_program_xilinx_end(EdtDev *edt_p);
01172 EDTAPI int edt_get_x_file_header(const char *fname, char *header, int *size);
01173 
01174 #if 0
01175 EDTAPI int edt_get_x_file_header_magic(char *fname, char *header, int *size, int *magic);
01176 EDTAPI int edt_get_x_array_header_rstat(u_char *ba, char *header, int *size);
01177 EDTAPI u_char *edt_get_x_array_header(u_char *ba, char *header, int *size);
01178 EDTAPI u_char *edt_get_x_array_header_magic(u_char *ba, char *header, int *size, int *magic);
01179 EDTAPI int edt_get_x_header_magic(FILE *fp, char *header, int *size, int *magic);
01180 EDTAPI void edt_readinfo(EdtDev *edt_p, int promcode, int segment, char *id, char *edtsn, char *oemsn);
01181 #endif
01182 
01183 EDTAPI int edt_x_get_fname(EdtDev *edt_p, char *name);
01184 EDTAPI int edt_x_get_fname_auto(EdtDev *edt_p, char *name);
01185 
01186 EDTAPI Edt_bdinfo *edt_detect_boards(char *dev, int unit, int *nunits, int verbose);
01187 EDTAPI Edt_bdinfo *edt_detect_boards_id(char *dev, int unit, u_int id, int *nunits, int verbose);
01188 EDTAPI Edt_bdinfo *edt_detect_boards_ids(char *dev, int unit, u_int *ids, int *nunits, int verbose);
01189 EDTAPI Edt_bdinfo *edt_detect_boards_filter(EdtBdFilterFunction filter, void *data, int *nunits, int verbose);
01190 
01191 EDTAPI int edt_sector_erase(EdtDev *edt_p, u_int sector, u_int sec_size, int type);
01192 
01193 /* routines to enable/disable register accesses tracing in the driver */
01194 
01195 EDTAPI void edt_set_trace_regs(EdtDev *edt_p, u_int reg_def, u_int state);
01196 
01197 EDTAPI void edt_trace_regs_enable(EdtDev *edt_p, u_int state);
01198 
01199 EDTAPI int edtdev_channels_from_type(EdtDev *edt_p);
01200 EDTAPI int edt_check_1_vs_4(EdtDev *edt_p);
01201 
01202 EDTAPI void edt_set_intr_mask(EdtDev *edt_p, u_int state);
01203 EDTAPI u_int edt_get_intr_mask(EdtDev *edt_p);
01204 EDTAPI void edt_set_remote_intr(EdtDev *edt_p, u_int onoff);
01205 EDTAPI u_int edt_get_remote_intr(EdtDev *edt_p);
01206 
01207 /*
01208  * routines for pciload instead of globals
01209  */
01210 EDTAPI void             edt_set_do_fast(int val) ;
01211 EDTAPI void             edt_set_force_slow(int val) ;
01212 EDTAPI int              edt_get_do_fast(void) ;
01213 EDTAPI int              edt_get_force_slow(void) ;
01214 EDTAPI int              edt_get_force(void) ;
01215 EDTAPI int              edt_get_debug_fast(void);
01216 EDTAPI int              edt_set_debug_fast(int val);
01217 EDTAPI u_char           edt_flipbits(u_char val);
01218 
01219 /* EDT_IOCTL definitions */
01220 EDTAPI int             edt_ioctl(EdtDev *, int code,   void *arg);
01221 EDTAPI int             edt_ioctl_nt(EdtDev *edt_p, int controlCode,
01222                                     void *inBuffer, int inSize, void *outBuffer,
01223                                     int outSize, int *bytesReturned) ;
01224 
01225 EDTAPI uchar_t          pcd_get_funct(EdtDev *edt_p) ;
01226 EDTAPI void             pcd_set_byteswap(EdtDev *edt_p, int val) ;
01227 EDTAPI int              pcd_set_statsig(EdtDev  *edt_p, int sig) ;
01228 EDTAPI uchar_t          pcd_get_stat(EdtDev *edt_p) ;
01229 EDTAPI uchar_t          pcd_get_stat_polarity(EdtDev *edt_p) ;
01230 EDTAPI void             pcd_set_stat_polarity(EdtDev *edt_p, uchar_t val)   ;
01231 EDTAPI unsigned char    pcd_get_cmd(EdtDev *edt_p) ;
01232 EDTAPI void             pcd_set_cmd(EdtDev *edt_p, uchar_t val) ;
01233 EDTAPI void             pcd_flush_channel(EdtDev * edt_p, int channel) ;
01234 
01235 #ifdef PCD
01236 EDTAPI u_char           pcd_get_option(EdtDev *edt_p) ;
01237 EDTAPI void             sse_shift(EdtDev *edt_p, int shift) ;
01238 EDTAPI double           sse_set_out_clk(EdtDev * edt_p, double fmhz) ;
01239 EDTAPI void             pcd_pio_init(EdtDev *edt_p) ;
01240 EDTAPI void             pcd_pio_flush_fifo(EdtDev * edt_p) ;
01241 EDTAPI int              pcd_pio_read(EdtDev *edt_p, u_char *buf, int size) ;
01242 EDTAPI int              pcd_pio_write(EdtDev *edt_p, u_char *buf, int size) ;
01243 EDTAPI void             pcd_pio_set_direction(EdtDev *edt_p, int direction) ;
01244 EDTAPI void             pcd_pio_intfc_write(EdtDev *, u_int, u_char)  ;
01245 EDTAPI u_char           pcd_pio_intfc_read(EdtDev *, u_int) ; 
01246 EDTAPI void             pcd_set_abortdma_onintr(EdtDev *edt_p, int flag) ;
01247 
01248 #endif /* PCD */
01249 
01250 #ifdef P16D
01251 EDTAPI void                     p16d_set_command(EdtDev *edt_p, u_short val) ;
01252 EDTAPI void                     p16d_set_config(EdtDev *edt_p, u_short val) ;
01253 EDTAPI u_short                  p16d_get_stat(EdtDev *edt_p) ;
01254 EDTAPI u_short                  p16d_get_command(EdtDev *edt_p) ;
01255 EDTAPI u_short                  p16d_get_config(EdtDev *edt_p) ;
01256 #endif /* P16D */
01257 
01258 #ifdef P11W
01259 EDTAPI void                     p11w_set_command(EdtDev *edt_p, u_short val) ;
01260 EDTAPI void                     p11w_set_config(EdtDev *edt_p, u_short val) ;
01261 EDTAPI void                     p11w_set_data(EdtDev *edt_p, u_short val) ;
01262 EDTAPI u_short                  p11w_get_command(EdtDev *edt_p) ;
01263 EDTAPI u_short                  p11w_get_config(EdtDev *edt_p) ;
01264 EDTAPI u_short                  p11w_get_stat(EdtDev *edt_p) ;
01265 EDTAPI u_short                  p11w_get_data(EdtDev *edt_p) ;
01266 EDTAPI u_int                    p11w_get_count(EdtDev *edt_p) ;
01267 EDTAPI void                     p11w_abortdma_onattn(EdtDev *edt_p, int flag) ;
01268 EDTAPI void             p11w_set_abortdma_onintr(EdtDev *edt_p, int flag) ;
01269 
01270 #endif /* P11W */
01271 
01272 #ifdef P53B
01273 EDTAPI EdtDev         *p53b_open(int unit, int bus_element_descriptor) ;
01274 EDTAPI EdtDev         *p53b_open_generic(int unit) ;
01275 EDTAPI EdtDev         *p53b_rtopen_notactive(int unit, int bus_element_descriptor) ;
01276 EDTAPI int             p53b_rtactive(EdtDev *p53b_p, int active) ;
01277 EDTAPI int             p53b_ioctl(EdtDev *p53b_p, int action, void *arg) ;
01278 EDTAPI int             p53b_write(EdtDev *p53b_p, void *buf, int size) ;
01279 EDTAPI int             p53b_read(EdtDev *p53b_p, void *buf, int size) ;
01280 EDTAPI int             p53b_bm_read(EdtDev *p53b_p, void *buf, int size) ;
01281 EDTAPI int             p53b_load(EdtDev *p53b_p, void *addr, int size, int offset) ;
01282 EDTAPI int             p53b_close(EdtDev *p53b_p) ;
01283 EDTAPI void            p53b_perror(char *str) ;
01284 EDTAPI void            p53b_msleep(int msecs) ;
01285 EDTAPI int             p53b_rt_blockwrite(EdtDev *p53b_p, int sa, int count, u_short *buf);
01286 EDTAPI int             p53b_rt_blockread(EdtDev *p53b_p, int sa, int count, u_short *buf);
01287 EDTAPI int             p53b_rt_prep_blockwrite(EdtDev *p53b_p, int sa) ;
01288 EDTAPI int             p53b_rt_prep_blockread(EdtDev *p53b_p, int sa) ;
01289 EDTAPI int             p53b_rt_flush_block_sa(EdtDev *p53b_p, u_int sa);
01290 EDTAPI int             p53b_rt_flush_block_rcv(EdtDev *p53b_p);
01291 
01292 
01293 #endif /* P53B */
01294 
01295 #if defined(VXWORKS) || defined(TEST_VXWORKS)
01296 EDTAPI int             edt_vx_system_register_func(const char *funcstr, int (funcptr)(char *));
01297 #endif
01298 
01299 
01300 #endif  /* KERNEL */
01301 
01302 #define edt_set_eodma_sig(p, s) edt_set_eodma_int(p, s)
01303 
01304 #define EDTIO_V0 0
01305 #define EIO_ACTION_MASK 0x000003ff      /* action is low 10 bits */
01306 #define EIO_SIZE_MASK   0x00fffc00      /* mask off bits 10-23 */
01307 #define EIO_SET         0x02000000  /* set is bit 25 */
01308 #define EIO_GET     0x01000000  /* get is bit 24 */
01309 #define EIO_SET_MASK    EIO_SET     /* set mask is same as set */
01310 #define EIO_GET_MASK    EIO_GET     /* get mask is same as get */
01311 #define EIO_SIZE_SHIFT  10      /* size -- shift down 10 bits */
01312 #define EIO_TYPE_SHIFT  24      /* to get type, shift down 22 bits */
01313 #define EIO_DECODE_ACTION(code) (code & EIO_ACTION_MASK)
01314 #define EIODA(code) EIO_DECODE_ACTION(code) /* shorthand, looks better in case stmts */
01315 #define EIO_DECODE_SIZE(code)   ((code & EIO_SIZE_MASK) >> EIO_SIZE_SHIFT)
01316 #define EIO_DECODE_SET(code)    ((code & EIO_SET_MASK) != 0)
01317 #define EIO_DECODE_GET(code)    ((code & EIO_GET_MASK) != 0)
01318 
01319 
01320 #if defined(__sun) || defined (_NT_) || defined(VXWORKS) || defined(__APPLE__)
01321 
01322 #define EDT_NT_IOCTL        0xf000f000
01323 
01324 #endif
01325 
01326 #ifdef __linux__
01327 
01328 #define EDT_IOC_MAGIC  'k'
01329 
01330 #define EDT_NT_IOCTL    _IOWR(EDT_IOC_MAGIC, 1, edt_ioctl_struct)
01331 #define EDT_NT_IOCTL32  _IOWR(EDT_IOC_MAGIC, 1, edt_ioctl_struct32)
01332 
01333 #define EDT_IOC_MAXNR   2
01334 
01335 #endif /* __linux__ */
01336 
01337 /*
01338  * This structure must correspond to the next edt_ioctl_struct
01339  * in order for 32-bit programs to run under 64-bit Linux.
01340  * This workaround was done for ioctl backwards compatibility purposes.
01341  * Mark Mason - Aug 2007
01342  */
01343 
01344 typedef struct {
01345 #ifdef __APPLE__
01346     uint_t device ;
01347 #else
01348     HANDLE device ;
01349 #endif
01350     uint_t controlCode  ;
01351     uint_t inSize   ;
01352     uint_t outSize ;
01353     uint_t bytesReturned ;
01354     uint32_t inBuffer ;      /* userspace address */
01355     uint32_t outBuffer ;     /* userspace address */
01356 #if defined(__APPLE__)
01357     u_short unit ;
01358     u_short channel ;
01359 #endif
01360 } edt_ioctl_struct32 ;
01361 
01362 /*
01363  * This structure must correspond to the above edt_ioctl_struct32
01364  * in order for 32-bit programs to run under 64-bit Linux.
01365  * Mark Mason - Aug 2007
01366  */
01367 typedef struct {
01368 #ifdef __APPLE__
01369     uint_t device ;
01370 #else
01371     HANDLE device ;
01372 #endif
01373     uint_t controlCode  ;
01374     uint_t inSize   ;
01375     uint_t outSize ;
01376     uint_t bytesReturned ;
01377     void *inBuffer ;
01378     void *outBuffer ;
01379 #if defined(__APPLE__)
01380     u_short unit ;
01381     u_short channel ;
01382 #endif
01383 } edt_ioctl_struct ;
01384 
01385 
01386 /* for passing 2 args */
01387 /* moved to long for 64-bit */
01388 typedef struct
01389 {
01390     /* must be multiple of 64 bits for amd64 */
01391     uint64_t    value;
01392     uint_t      desc;
01393     uint_t      flags ;
01394 } edt_buf;
01395 
01396 
01397 /* for serial read and write */
01398 #define EDT_SERBUF_SIZE 2048
01399 #define EDT_SERBUF_OVRHD 16      /* size of all but buf */
01400 /* flags for serial */
01401 #define EDT_SERIAL_WAITRESP     1
01402 #define EDT_SERIAL_SAVERESP     2
01403 typedef struct
01404 {
01405     uint_t      unit;
01406     uint_t      size;
01407     uint_t      misc;
01408     uint_t      flags;
01409     char        buf[EDT_SERBUF_SIZE];
01410 } ser_buf;
01411 
01412 /* for describing ring buffer */
01413 typedef struct
01414 {
01415     uint64_t    addr ;
01416     uint_t      index ;
01417     uint_t         size ;
01418     uint_t         writeflag ;
01419 } buf_args;
01420 
01421 /* for specifying merging data between multiple boards or channels */
01422 /* or for flipping or interleaving image */
01423 typedef struct
01424 {
01425     uint_t      line_size ;
01426     int         line_span ;     /* can be negative */
01427     uint_t      line_offset ;
01428     uint_t      line_count ;
01429 } edt_merge_args;
01430 
01431 
01432 
01433 typedef struct {
01434     u_int addr ;
01435     u_int size ;
01436     u_int inc  ;
01437     u_int cnt  ;
01438     u_int mask ;
01439 } p53b_test ;
01440 
01441 #define SIZED_DATASIZE (EDT_DEPSIZE - sizeof(u_int))
01442 
01443 typedef struct {
01444     u_int size;
01445     u_int data[SIZED_DATASIZE/4];
01446 } edt_sized_buffer;
01447 
01448 #define EDT_DEVICE_TYPE     0x8000
01449 #ifdef METHOD_BUFFERED
01450 #define EDT_MAKE_IOCTL(t,c)\
01451     (uint_t)CTL_CODE((t),   0x800+(c),  METHOD_BUFFERED, FILE_ANY_ACCESS)
01452 #else
01453 #define EDT_MAKE_IOCTL(t,c)\
01454     (uint_t)(c)
01455 #endif
01456 
01457 #define EIOC(action, type, size) (((uint_t)type)    \
01458                 | (((uint_t)size) << EIO_SIZE_SHIFT) \
01459                 | ((uint_t)action))
01460 
01461 #define EDTS_DEBUG              EIOC(10, EIO_SET, sizeof(uint_t))
01462 #define EDTG_DEBUG              EIOC(11, EIO_GET, sizeof(uint_t))
01463 #define EDTS_INTFC              EIOC(12, EIO_SET, sizeof(edt_buf))
01464 #define EDTG_INTFC              EIOC(13, EIO_GET|EIO_SET, sizeof(edt_buf))
01465 #define EDTS_REG                EIOC(14, EIO_SET, sizeof(edt_buf))
01466 #define EDTG_REG                EIOC(15, EIO_GET|EIO_SET, sizeof(edt_buf))
01467 #define EDTS_FLASH              EIOC(16, EIO_SET, sizeof(edt_buf))
01468 #define EDTG_FLASH              EIOC(17, EIO_GET|EIO_SET, sizeof(edt_buf))
01469 #define EDTG_CHECKBF            EIOC(18, EIO_GET|EIO_SET, sizeof(buf_args))
01470 #define EDTS_PROG               EIOC(19, EIO_SET, sizeof(uint_t))
01471 #define EDTG_PROG               EIOC(20, EIO_GET, sizeof(uint_t))
01472 #define EDTS_PROG_READBACK      EIOC(21, EIO_SET, sizeof(uint_t))
01473 #define EDTG_PROG_READBACK      EIOC(22, EIO_GET, sizeof(uint_t))
01474 #define EDTS_HEIGHT             EIOC(23, EIO_SET, sizeof(uint_t))
01475 #define EDTG_HEIGHT             EIOC(24, EIO_GET, sizeof(uint_t))
01476 #define EDTS_DEPTH              EIOC(25, EIO_SET, sizeof(uint_t))
01477 #define EDTG_DEPTH              EIOC(26, EIO_GET, sizeof(uint_t))
01478 #define EDTS_TYPE               EIOC(27, EIO_SET, sizeof(uint_t))
01479 #define EDTG_TYPE               EIOC(28, EIO_GET, sizeof(uint_t))
01480 #define EDTS_SERIAL             EIOC(29, EIO_SET, sizeof(uint_t))
01481 #define EDTG_SERIAL             EIOC(30, EIO_GET, sizeof(uint_t))
01482 #define EDTS_DEPENDENT          EIOC(31, EIO_SET, EDT_DEPSIZE)
01483 #define EDTG_DEPENDENT          EIOC(32, EIO_GET, EDT_DEPSIZE)
01484 #define EDTG_DEVID              EIOC(33, EIO_GET, sizeof(uint_t))
01485 #define EDTS_RTIMEOUT           EIOC(34, EIO_SET, sizeof(uint_t))
01486 #define EDTS_WTIMEOUT           EIOC(35, EIO_SET, sizeof(uint_t))
01487 #define EDTG_BUFDONE            EIOC(36, EIO_GET, sizeof(bufcnt_t))
01488 #define EDTS_NUMBUFS            EIOC(37, EIO_SET, sizeof(int))
01489 #define EDTS_BUF                EIOC(38, EIO_SET, sizeof(buf_args))
01490 #define EDTS_STARTBUF           EIOC(39, EIO_SET, sizeof(uint_t))
01491 #define EDTS_WAITBUF            EIOC(40, EIO_SET|EIO_GET, sizeof(uint_t))
01492 #define EDTS_FREEBUF            EIOC(41, EIO_SET, sizeof(uint_t))
01493 #define EDTS_STOPBUF            EIOC(42, EIO_SET, sizeof(uint_t))
01494 #define EDTG_BYTECOUNT          EIOC(44, EIO_GET, sizeof(uint_t))
01495 #define EDTS_SETBUF             EIOC(45, EIO_SET, sizeof(int))
01496 #define EDTS_ABORT_DELAY           EIOC(46, EIO_SET, sizeof(int))
01497 #define EDTG_TIMEOUTS           EIOC(47, EIO_GET, sizeof(int))
01498 #define EDTG_TRACEBUF           EIOC(48, EIO_GET, (EDT_TRACESIZE  * sizeof(int)))
01499 #define EDTS_STARTDMA           EIOC(49, EIO_SET, sizeof(edt_buf))
01500 #define EDTS_ENDDMA             EIOC(50, EIO_SET, sizeof(edt_buf))
01501 #define EDTS_FOIUNIT            EIOC(51, EIO_SET, sizeof(int))
01502 #define EDTG_FOIUNIT            EIOC(52, EIO_GET, sizeof(int))
01503 #define EDTS_FOICOUNT           EIOC(53, EIO_SET, sizeof(int))
01504 #define EDTG_FOICOUNT           EIOC(54, EIO_GET, sizeof(int))
01505 #define EDTG_RTIMEOUT           EIOC(55, EIO_GET, sizeof(uint_t))
01506 #define EDTG_WTIMEOUT           EIOC(56, EIO_GET, sizeof(uint_t))
01507 #define EDTS_EODMA_SIG          EIOC(57, EIO_SET, sizeof(uint_t))
01508 #define EDTS_SERIALWAIT         EIOC(58, EIO_SET|EIO_GET, sizeof(edt_buf))
01509 #define EDTS_EVENT_SIG          EIOC(59, EIO_SET, sizeof(edt_buf))
01510 #define EDTG_OVERFLOW           EIOC(60, EIO_GET, sizeof(u_int))
01511 #define EDTS_AUTODIR            EIOC(61, EIO_SET, sizeof(u_int))
01512 #define EDTS_FIRSTFLUSH         EIOC(62, EIO_SET, sizeof(u_int))
01513 #define EDTG_CONFIG_COPY        EIOC(63, EIO_GET|EIO_SET, sizeof(edt_buf))
01514 #define EDTG_CONFIG             EIOC(64, EIO_GET|EIO_SET, sizeof(edt_buf))
01515 #define EDTS_CONFIG             EIOC(65, EIO_SET, sizeof(edt_buf))
01516 #define P53B_REGTEST            EIOC(66, EIO_SET, sizeof(p53b_test))
01517 #define EDTG_LONG               EIOC(67, EIO_GET|EIO_SET, sizeof(edt_buf))
01518 #define EDTS_LONG               EIOC(68, EIO_SET, sizeof(edt_buf))
01519 #define EDTG_SGTODO             EIOC(69, EIO_GET, (EDT_TRACESIZE *  4))
01520 #define EDTG_SGLIST             EIOC(70, EIO_SET|EIO_GET, sizeof(buf_args))
01521 #define EDTS_SGLIST             EIOC(71, EIO_SET, sizeof(buf_args))
01522 #define EDTG_SGINFO             EIOC(72, EIO_SET|EIO_GET, sizeof(edt_buf))
01523 #define EDTG_TIMECOUNT          EIOC(73, EIO_GET, sizeof(uint_t))
01524 #define EDTG_PADDR              EIOC(74, EIO_GET, sizeof(uint_t))
01525 #define EDTS_SYNC               EIOC(75, EIO_SET, sizeof(uint_t))
01526 #define EDTS_WAITN              EIOC(76, EIO_SET, sizeof(uint_t))
01527 #define EDTS_STARTACT           EIOC(77, EIO_SET, sizeof(uint_t))
01528 #define EDTS_ENDACT             EIOC(78, EIO_SET, sizeof(uint_t))
01529 #define EDTS_RESETCOUNT         EIOC(79, EIO_SET, sizeof(uint_t))
01530 #define EDTS_RESETSERIAL        EIOC(80, EIO_SET, sizeof(uint_t))
01531 #define EDTS_CLR_EVENT          EIOC(81, EIO_SET, sizeof(uint_t))
01532 #define EDTS_ADD_EVENT_FUNC     EIOC(82, EIO_SET, sizeof(uint_t))
01533 #define EDTS_DEL_EVENT_FUNC     EIOC(83, EIO_SET, sizeof(uint_t))
01534 #define EDTS_WAIT_EVENT_ONCE    EIOC(84, EIO_SET, sizeof(uint_t))
01535 #define EDTS_WAIT_EVENT             EIOC(85, EIO_SET, sizeof(uint_t))
01536 #define EDTS_CLEAR_WAIT_EVENT   EIOC(86, EIO_SET, sizeof(uint_t))
01537 #define EDTG_TMSTAMP            EIOC(87, EIO_SET|EIO_GET, sizeof(uint_t) * 3)
01538 #define EDTS_TIMEOUT_ACTION     EIOC(88, EIO_SET, sizeof(uint_t))
01539 #define EDTG_TIMEOUT_GOODBITS   EIOC(89, EIO_GET, sizeof(uint_t))
01540 #define EDTS_BAUDBITS           EIOC(90, EIO_SET, sizeof(uint_t))
01541 #define EDTG_REFTIME            EIOC(91, EIO_GET, sizeof(uint_t) * 2)
01542 #define EDTS_REFTIME            EIOC(92, EIO_SET, sizeof(uint_t) * 2)
01543 #define EDTS_REG_OR             EIOC(93, EIO_SET|EIO_GET, sizeof(edt_buf))
01544 #define EDTS_REG_AND            EIOC(94, EIO_SET|EIO_GET, sizeof(edt_buf))
01545 #define EDTG_GOODBITS                   EIOC(95, EIO_GET, sizeof(uint_t))
01546 #define EDTS_BURST_EN                   EIOC(96, EIO_SET, sizeof(uint_t))
01547 #define EDTG_BURST_EN                   EIOC(97, EIO_GET, sizeof(uint_t))
01548 #define EDTG_FIRSTFLUSH         EIOC(98, EIO_GET, sizeof(u_int))
01549 #define EDTS_ABORT_BP                   EIOC(99, EIO_SET, sizeof(uint_t))
01550 #define EDTS_DMASYNC_FORDEV     EIOC(100, EIO_SET, sizeof(uint_t) * 3)
01551 #define EDTS_DMASYNC_FORCPU     EIOC(101, EIO_SET, sizeof(uint_t) * 3)
01552 #define EDTG_BUFBYTECOUNT       EIOC(102, EIO_GET, sizeof(uint_t) * 2)
01553 #define EDTS_DOTIMEOUT          EIOC(103, EIO_SET, sizeof(uint_t))
01554 #define EDTS_REFTMSTAMP         EIOC(104, EIO_SET, sizeof(uint_t))
01555 #define EDTS_PDVCONT            EIOC(105, EIO_SET, sizeof(uint_t))
01556 #define EDTS_PDVDPATH           EIOC(106, EIO_SET, sizeof(uint_t))
01557 #define EDTS_RESET_EVENT_COUNTER        EIOC(107, EIO_SET, sizeof(uint_t))
01558 #define EDTS_DUMP_SGLIST        EIOC(108, EIO_SET, sizeof(uint_t))
01559 #define EDTG_TODO              EIOC(109, EIO_GET, sizeof(u_int))
01560 #define EDTS_RESUME            EIOC(110, EIO_SET, sizeof(u_int))
01561 #define EDTS_TIMETYPE          EIOC(111, EIO_SET, sizeof(u_int))
01562 #define EDTS_EVENT_HNDL        EIOC(112, EIO_SET, sizeof(edt_buf))
01563 #define EDTS_MAX_BUFFERS           EIOC(113, EIO_SET, sizeof(u_int))
01564 #define EDTG_MAX_BUFFERS           EIOC(114, EIO_GET, sizeof(u_int))
01565 #define EDTS_WRITE_PIO             EIOC(115, EIO_SET, sizeof(edt_sized_buffer))
01566 #define EDTS_PROG_XILINX           EIOC(116, EIO_SET, sizeof(edt_sized_buffer))
01567 #define EDTS_MAPMEM            EIOC(117, EIO_GET | EIO_SET, sizeof(edt_buf))
01568 #define EDTS_ETEC_ERASEBUF_INIT    EIOC(118, EIO_SET, sizeof(uint_t) * 2)
01569 #define EDTS_ETEC_ERASEBUF         EIOC(119, EIO_SET, sizeof(u_int))
01570 #define EDTG_DRIVER_TYPE         EIOC(120, EIO_GET, sizeof(u_int))
01571 #define EDTS_DRIVER_TYPE         EIOC(121, EIO_SET, sizeof(u_int))
01572 #define EDTS_DRV_BUFFER        EIOC(122, EIO_SET | EIO_GET, sizeof(u_int))
01573 #define EDTS_ABORTINTR         EIOC(123, EIO_SET, sizeof(u_int))
01574 #define EDTS_CUSTOMER          EIOC(124, EIO_SET, sizeof(u_int))
01575 #define EDTS_ETEC_SET_IDLE     EIOC(125, EIO_SET, sizeof(u_int) * 3)
01576 #define EDTS_SOLARIS_DMA_MODE  EIOC(126, EIO_SET, sizeof(u_int))
01577 #define EDTS_UMEM_LOCK         EIOC(127, EIO_SET, sizeof(u_int))
01578 #define EDTG_UMEM_LOCK         EIOC(128, EIO_GET, sizeof(u_int))
01579 #define EDTS_RCI_CHAN          EIOC(129, EIO_SET, sizeof(edt_buf))
01580 #define EDTG_RCI_CHAN          EIOC(130, EIO_SET|EIO_GET, sizeof(edt_buf))
01581 #define EDTS_BITPATH           EIOC(140, EIO_SET, sizeof(edt_bitpath))
01582 #define EDTG_BITPATH           EIOC(141, EIO_GET, sizeof(edt_bitpath))
01583 #define EDTG_VERSION           EIOC(142, EIO_GET, sizeof(edt_version_string))
01584 #define EDTG_BUILDID           EIOC(143, EIO_GET, sizeof(edt_version_string))
01585 #define EDTS_WAITCHAR          EIOC(144, EIO_SET, sizeof(edt_buf))
01586 #define EDTS_PDMA_MODE         EIOC(145, EIO_SET, sizeof(u_int))
01587 #define EDTG_MEMSIZE           EIOC(146, EIO_GET, sizeof(u_int))
01588 #define EDTS_DIRECTION         EIOC(147, EIO_SET, sizeof(u_int))
01589 #define EDTG_CLRCIFLAGS        EIOC(148, EIO_GET, sizeof(u_int))
01590 #define EDTS_CLRCIFLAGS        EIOC(149, EIO_SET, sizeof(u_int))
01591 #define EDTS_MERGEPARMS        EIOC(150, EIO_SET, sizeof(edt_merge_args))
01592 #define EDTS_ABORTDMA_ONINTR   EIOC(151, EIO_SET, sizeof(u_int))
01593 #define EDTS_FVAL_DONE        EIOC(152, EIO_SET, sizeof(u_char))
01594 #define EDTG_FVAL_DONE        EIOC(153, EIO_GET, sizeof(u_char))
01595 #define EDTG_LINES_XFERRED        EIOC(154, EIO_SET|EIO_GET, sizeof(u_int))
01596 #define EDTS_PROCESS_ISR        EIOC(155, EIO_SET|EIO_GET, sizeof(u_int))
01597 #define EDTS_CLEAR_DMAID        EIOC(156, EIO_SET, sizeof(u_int))
01598 #define EDTS_DRV_BUFFER_LEAD        EIOC(157, EIO_SET | EIO_GET, sizeof(u_int))
01599 #define EDTG_SERIAL_WRITE_AVAIL        EIOC(158, EIO_GET, sizeof(u_int))
01600 #define EDTS_USER_DMA_WAKEUP        EIOC(159, EIO_SET, sizeof(u_int))
01601 #define EDTG_USER_DMA_WAKEUP        EIOC(160, EIO_GET, sizeof(u_int))
01602 #define EDTG_WAIT_STATUS            EIOC(161, EIO_GET, sizeof(u_int))
01603 #define EDTS_WAIT_STATUS            EIOC(162, EIO_GET, sizeof(u_int))
01604 #define EDTS_TIMEOUT_OK             EIOC(163, EIO_SET, sizeof(u_int))
01605 #define EDTG_TIMEOUT_OK             EIOC(164, EIO_GET, sizeof(u_int))
01606 #define EDTS_MULTI_DONE             EIOC(165, EIO_GET, sizeof(u_int))
01607 #define EDTG_MULTI_DONE             EIOC(166, EIO_GET, sizeof(u_int))
01608 #define EDTS_TEST_LOCK_ON           EIOC(167, EIO_SET, sizeof(u_int))
01609 #define EDTG_FVAL_LOW        EIOC(168, EIO_SET|EIO_GET, sizeof(u_int))
01610 #define EDTS_BUF_MMAP                EIOC(169, EIO_SET, sizeof(buf_args))
01611 #define EDTS_MEZZ_BITPATH       EIOC(170, EIO_SET, sizeof(edt_bitpath))
01612 #define EDTG_MEZZ_BITPATH       EIOC(171, EIO_GET, sizeof(edt_bitpath))
01613 #define EDTG_DMA_INFO           EIOC(172, EIO_GET, sizeof(edt_dma_info))
01614 #define EDTS_USER_FUNC          EIOC(173, EIO_SET | EIO_GET, sizeof(edt_sized_buffer))
01615 #define EDTS_TEST_STATUS          EIOC(174, EIO_SET | EIO_GET, sizeof(u_int))
01616 #define EDTS_KERNEL_ALLOC          EIOC(175, EIO_SET | EIO_GET, sizeof(u_int))
01617 #define EDTG_RESERVED_PAGES          EIOC(176, EIO_GET, sizeof(u_int))
01618 #define EDTS_RAW_SGLIST             EIOC(177, EIO_SET, sizeof(buf_args))
01619 #define EDTS_IGNORE_SIGNALS          EIOC(178, EIO_SET, sizeof(u_int))
01620 #define EDTS_TRACE_REG             EIOC(179, EIO_SET, sizeof(u_int))
01621 #define EDTS_TIMESTAMP_LEVEL       EIOC(180, EIO_SET, sizeof(u_int))
01622 #define EDTS_REG_BIT_CLEARSET       EIOC(181, EIO_SET, sizeof(edt_buf))
01623 #define EDTS_REG_BIT_SETCLEAR       EIOC(182, EIO_SET, sizeof(edt_buf))
01624 #define EDTS_REG_READBACK           EIOC(183, EIO_SET, sizeof(u_int))
01625 #define EDTS_MEZZ_ID                EIOC(184, EIO_SET, sizeof(edt_buf))
01626 #define EDTG_MEZZ_ID                EIOC(185, EIO_SET|EIO_GET, sizeof(edt_buf))
01627 #define EDTG_NUMBUFS            EIOC(186, EIO_GET, sizeof(int))
01628 #define EDTS_READ_STARTACT      EIOC(187, EIO_SET, sizeof(edt_buf))
01629 #define EDTS_READ_ENDACT        EIOC(188, EIO_SET, sizeof(edt_buf))
01630 #define EDTS_WRITE_STARTACT     EIOC(189, EIO_SET, sizeof(edt_buf))
01631 #define EDTS_WRITE_ENDACT       EIOC(190, EIO_SET, sizeof(edt_buf))
01632 #define EDTS_READ_START_DELAYS  EIOC(191, EIO_SET, sizeof(u_int))
01633 #define EDTS_READ_END_DELAYS    EIOC(192, EIO_SET, sizeof(u_int))
01634 #define EDTS_WRITE_START_DELAYS EIOC(193, EIO_SET, sizeof(u_int))
01635 #define EDTS_WRITE_END_DELAYS   EIOC(194, EIO_SET, sizeof(u_int))
01636 #define EDTS_INDIRECT_REG_BASE  EIOC(195, EIO_SET, sizeof(u_int))
01637 #define EDTG_INDIRECT_REG_BASE  EIOC(196, EIO_GET, sizeof(u_int))
01638 #define EDTS_BITLOAD            EIOC(197, EIO_SET|EIO_GET, sizeof(buf_args))
01639 #define EDTS_MEZZLOAD           EIOC(198, EIO_SET|EIO_GET, sizeof(buf_args))
01640 #define EDTS_PCILOAD            EIOC(199, EIO_SET, sizeof(buf_args))
01641 #define EDTS_INTR_MASK          EIOC(210, EIO_SET, sizeof(u_int))
01642 #define EDTG_INTR_MASK          EIOC(211, EIO_GET, sizeof(u_int))
01643 
01644 
01645 /* defines for return from wait */
01646 #define EDT_WAIT_OK     0
01647 #define EDT_WAIT_TIMEOUT 1
01648 #define EDT_WAIT_OK_TIMEOUT 2
01649 #define EDT_WAIT_USER_WAKEUP 3
01650 
01651 /* defines for driver type */
01652 #define EDT_UNIX_DRIVER 0
01653 #define EDT_NT_DRIVER   1
01654 #define EDT_2K_DRIVER   2
01655 #define EDT_WDM_DRIVER  3
01656 
01657 /* defines for time type */
01658 #define EDT_TM_SEC_NSEC  0
01659 #define EDT_TM_CLICKS    1
01660 #define EDT_TM_COUNTER   2
01661 #define EDT_TM_FREQ      3
01662 #define EDT_TM_INTR      4
01663 
01664 
01665 /* defines for get DMA status */
01666 #define EDT_DMA_IDLE 0
01667 #define EDT_DMA_ACTIVE 1
01668 #define EDT_DMA_TIMEOUT 2
01669 #define EDT_DMA_ABORTED 3
01670 
01671 /* defines for SG ioctls */
01672 #define EDT_SGLIST_SIZE     1
01673 #define EDT_SGLIST_VIRTUAL  2
01674 #define EDT_SGLIST_PHYSICAL 3
01675 #define EDT_SGTODO_SIZE     4
01676 #define EDT_SGTODO_VIRTUAL  5
01677 #define EDT_SGTODO_FIRST_SG 6
01678 
01679 
01680 /* defines for flush, start, end dma action */
01681 #define EDT_ACT_NEVER       0
01682 #define EDT_ACT_ONCE        1
01683 #define EDT_ACT_ALWAYS      2
01684 #define EDT_ACT_ONELEFT     3
01685 #define EDT_ACT_CYCLE           4 
01686 #define EDT_ACT_KBS             5 
01687 #define EDT_ACT_ALWAYS_WRITEONLY                6
01688 
01689 /* ddefines for timeout action */
01690 #define EDT_TIMEOUT_NULL                0
01691 #define EDT_TIMEOUT_BIT_STROBE  0x1
01692 
01693 
01694 /* for kernel defines, use this shorthand */
01695 #define EMAPI(x) EDT_MAKE_IOCTL(EDT_DEVICE_TYPE,EIODA(x))
01696 
01697 #define ES_DEBUG             EMAPI(EDTS_DEBUG)
01698 #define EG_DEBUG             EMAPI(EDTG_DEBUG)
01699 #define ES_INTFC             EMAPI(EDTS_INTFC)
01700 #define EG_INTFC             EMAPI(EDTG_INTFC)
01701 #define ES_REG               EMAPI(EDTS_REG)
01702 #define EG_REG               EMAPI(EDTG_REG)
01703 #define ES_FLASH             EMAPI(EDTS_FLASH)
01704 #define EG_FLASH             EMAPI(EDTG_FLASH)
01705 #define EG_CHECKBF             EMAPI(EDTG_CHECKBF)
01706 #define ES_PROG              EMAPI(EDTS_PROG)
01707 #define EG_PROG              EMAPI(EDTG_PROG)
01708 #define ES_PROG_READBACK     EMAPI(EDTS_PROG_READBACK)
01709 #define EG_PROG_READBACK     EMAPI(EDTG_PROG_READBACK)
01710 #define ES_HEIGHT            EMAPI(EDTS_HEIGHT)
01711 #define EG_HEIGHT            EMAPI(EDTG_HEIGHT)
01712 #define ES_DEPTH             EMAPI(EDTS_DEPTH)
01713 #define EG_DEPTH             EMAPI(EDTG_DEPTH)
01714 #define ES_TYPE              EMAPI(EDTS_TYPE)
01715 #define EG_TYPE              EMAPI(EDTG_TYPE)
01716 #define ES_SERIAL            EMAPI(EDTS_SERIAL)
01717 #define EG_SERIAL            EMAPI(EDTG_SERIAL)
01718 #define ES_DEPENDENT         EMAPI(EDTS_DEPENDENT)
01719 #define EG_DEPENDENT         EMAPI(EDTG_DEPENDENT)
01720 #define EG_DEVID             EMAPI(EDTG_DEVID)
01721 #define ES_RTIMEOUT          EMAPI(EDTS_RTIMEOUT)
01722 #define ES_WTIMEOUT          EMAPI(EDTS_WTIMEOUT)
01723 #define EG_BUFDONE           EMAPI(EDTG_BUFDONE)
01724 #define ES_NUMBUFS           EMAPI(EDTS_NUMBUFS)
01725 #define ES_BUF               EMAPI(EDTS_BUF)
01726 #define ES_BUF_MMAP               EMAPI(EDTS_BUF_MMAP)
01727 #define ES_STARTBUF          EMAPI(EDTS_STARTBUF)
01728 #define ES_WAITBUF           EMAPI(EDTS_WAITBUF)
01729 #define ES_FREEBUF           EMAPI(EDTS_FREEBUF)
01730 #define ES_STOPBUF           EMAPI(EDTS_STOPBUF)
01731 #define EG_BYTECOUNT         EMAPI(EDTG_BYTECOUNT)
01732 #define ES_SETBUF            EMAPI(EDTS_SETBUF)
01733 #define ES_ABORT_DELAY          EMAPI(EDTS_ABORT_DELAY)
01734 #define EG_TIMEOUTS          EMAPI(EDTG_TIMEOUTS)
01735 #define EG_TRACEBUF          EMAPI(EDTG_TRACEBUF)
01736 #define ES_STARTDMA          EMAPI(EDTS_STARTDMA)
01737 #define ES_ENDDMA            EMAPI(EDTS_ENDDMA)
01738 #define ES_FOIUNIT           EMAPI(EDTS_FOIUNIT)
01739 #define EG_FOIUNIT           EMAPI(EDTG_FOIUNIT)
01740 #define ES_FOICOUNT          EMAPI(EDTS_FOICOUNT)
01741 #define EG_FOICOUNT          EMAPI(EDTG_FOICOUNT)
01742 #define EG_RTIMEOUT          EMAPI(EDTG_RTIMEOUT)
01743 #define EG_WTIMEOUT          EMAPI(EDTG_WTIMEOUT)
01744 #define ES_EODMA_SIG         EMAPI(EDTS_EODMA_SIG)
01745 #define ES_SERIALWAIT        EMAPI(EDTS_SERIALWAIT)
01746 #define ES_EVENT_SIG         EMAPI(EDTS_EVENT_SIG)
01747 #define EG_OVERFLOW          EMAPI(EDTG_OVERFLOW)
01748 #define ES_AUTODIR           EMAPI(EDTS_AUTODIR)
01749 #define ES_FIRSTFLUSH        EMAPI(EDTS_FIRSTFLUSH)
01750 #define EG_FIRSTFLUSH        EMAPI(EDTG_FIRSTFLUSH)
01751 #define EG_CONFIG_COPY       EMAPI(EDTG_CONFIG_COPY)
01752 #define ES_CONFIG            EMAPI(EDTS_CONFIG)
01753 #define EG_CONFIG            EMAPI(EDTG_CONFIG)
01754 #define P_REGTEST            EMAPI(P53B_REGTEST)
01755 #define ES_LONG              EMAPI(EDTS_LONG)
01756 #define EG_LONG              EMAPI(EDTG_LONG)
01757 #define EG_SGTODO            EMAPI(EDTG_SGTODO)
01758 #define EG_SGLIST            EMAPI(EDTG_SGLIST)
01759 #define ES_SGLIST            EMAPI(EDTS_SGLIST)
01760 #define EG_SGINFO            EMAPI(EDTG_SGINFO)
01761 #define EG_TIMECOUNT         EMAPI(EDTG_TIMECOUNT)
01762 #define EG_PADDR             EMAPI(EDTG_PADDR)
01763 #define ES_SYNC              EMAPI(EDTS_SYNC)
01764 #define ES_WAITN             EMAPI(EDTS_WAITN)
01765 #define ES_STARTACT          EMAPI(EDTS_STARTACT)
01766 #define ES_ENDACT            EMAPI(EDTS_ENDACT)
01767 #define ES_RESETCOUNT        EMAPI(EDTS_RESETCOUNT)
01768 #define ES_RESETSERIAL       EMAPI(EDTS_RESETSERIAL)
01769 #define ES_BAUDBITS          EMAPI(EDTS_BAUDBITS)
01770 #define ES_CLR_EVENT         EMAPI(EDTS_CLR_EVENT)
01771 #define ES_ADD_EVENT_FUNC    EMAPI(EDTS_ADD_EVENT_FUNC)
01772 #define ES_DEL_EVENT_FUNC    EMAPI(EDTS_DEL_EVENT_FUNC)
01773 #define ES_WAIT_EVENT_ONCE   EMAPI(EDTS_WAIT_EVENT_ONCE)
01774 #define ES_WAIT_EVENT        EMAPI(EDTS_WAIT_EVENT)
01775 #define EG_TMSTAMP           EMAPI(EDTG_TMSTAMP)
01776 #define ES_CLEAR_WAIT_EVENT  EMAPI(EDTS_CLEAR_WAIT_EVENT)
01777 #define ES_TIMEOUT_ACTION    EMAPI(EDTS_TIMEOUT_ACTION)
01778 #define EG_TIMEOUT_GOODBITS  EMAPI(EDTG_TIMEOUT_GOODBITS)
01779 #define EG_REFTIME                       EMAPI(EDTG_REFTIME)
01780 #define ES_REFTIME                       EMAPI(EDTS_REFTIME)
01781 #define ES_REG_OR                        EMAPI(EDTS_REG_OR)
01782 #define ES_REG_AND                       EMAPI(EDTS_REG_AND)
01783 #define EG_GOODBITS                      EMAPI(EDTG_GOODBITS)
01784 #define ES_BURST_EN                      EMAPI(EDTS_BURST_EN)
01785 #define EG_BURST_EN                      EMAPI(EDTG_BURST_EN)
01786 #define ES_ABORT_BP                      EMAPI(EDTS_ABORT_BP)
01787 #define ES_DOTIMEOUT             EMAPI(EDTS_DOTIMEOUT)
01788 #define ES_REFTMSTAMP           EMAPI(EDTS_REFTMSTAMP)
01789 #define ES_DMASYNC_FORDEV     EMAPI(EDTS_DMASYNC_FORDEV)
01790 #define ES_DMASYNC_FORCPU     EMAPI(EDTS_DMASYNC_FORCPU)
01791 #define EG_BUFBYTECOUNT       EMAPI(EDTG_BUFBYTECOUNT)
01792 #define ES_PDVCONT            EMAPI(EDTS_PDVCONT)
01793 #define ES_PDVDPATH           EMAPI(EDTS_PDVDPATH)
01794 #define ES_RESET_EVENT_COUNTER        EMAPI(EDTS_RESET_EVENT_COUNTER)
01795 #define ES_DUMP_SGLIST        EMAPI(EDTS_DUMP_SGLIST)
01796 #define EG_TODO                 EMAPI(EDTG_TODO)
01797 #define ES_RESUME                       EMAPI(EDTS_RESUME)
01798 #define ES_TIMETYPE            EMAPI(EDTS_TIMETYPE)
01799 #define ES_EVENT_HNDL          EMAPI(EDTS_EVENT_HNDL)
01800 #define ES_MAX_BUFFERS                 EMAPI(EDTS_MAX_BUFFERS)
01801 #define EG_MAX_BUFFERS                 EMAPI(EDTG_MAX_BUFFERS)
01802 #define ES_WRITE_PIO           EMAPI(EDTS_WRITE_PIO)
01803 #define ES_PROG_XILINX                 EMAPI(EDTS_PROG_XILINX)
01804 #define ES_MAPMEM              EMAPI(EDTS_MAPMEM)
01805 #define ES_ETEC_ERASEBUF_INIT    EMAPI(EDTS_ETEC_ERASEBUF_INIT)
01806 #define ES_ETEC_ERASEBUF         EMAPI(EDTS_ETEC_ERASEBUF)
01807 #define EG_DRIVER_TYPE         EMAPI(EDTG_DRIVER_TYPE)
01808 #define ES_DRIVER_TYPE         EMAPI(EDTS_DRIVER_TYPE)
01809 #define ES_DRV_BUFFER          EMAPI(EDTS_DRV_BUFFER)
01810 #define ES_ABORTINTR           EMAPI(EDTS_ABORTINTR)
01811 #define ES_CUSTOMER            EMAPI(EDTS_CUSTOMER)
01812 #define ES_ETEC_SET_IDLE       EMAPI(EDTS_ETEC_SET_IDLE)
01813 #define ES_SOLARIS_DMA_MODE    EMAPI(EDTS_SOLARIS_DMA_MODE)
01814 #define ES_UMEM_LOCK           EMAPI(EDTS_UMEM_LOCK)
01815 #define EG_UMEM_LOCK           EMAPI(EDTG_UMEM_LOCK)
01816 #define ES_RCI_CHAN            EMAPI(EDTS_RCI_CHAN)
01817 #define EG_RCI_CHAN            EMAPI(EDTG_RCI_CHAN)
01818 #define ES_BITPATH             EMAPI(EDTS_BITPATH)
01819 #define EG_BITPATH             EMAPI(EDTG_BITPATH)
01820 #define EG_VERSION         EMAPI(EDTG_VERSION)
01821 #define EG_BUILDID         EMAPI(EDTG_BUILDID)
01822 #define ES_WAITCHAR         EMAPI(EDTS_WAITCHAR)
01823 #define ES_PDMA_MODE           EMAPI(EDTS_PDMA_MODE)
01824 #define ES_DIRECTION           EMAPI(EDTS_DIRECTION)
01825 #define EG_MEMSIZE          EMAPI(EDTG_MEMSIZE)
01826 #define ES_CLRCIFLAGS         EMAPI(EDTS_CLRCIFLAGS)
01827 #define EG_CLRCIFLAGS         EMAPI(EDTG_CLRCIFLAGS)
01828 #define ES_MERGEPARMS        EMAPI(EDTS_MERGEPARMS)
01829 #define ES_ABORTDMA_ONINTR        EMAPI(EDTS_ABORTDMA_ONINTR)
01830 #define ES_FVAL_DONE         EMAPI(EDTS_FVAL_DONE)
01831 #define EG_FVAL_DONE         EMAPI(EDTG_FVAL_DONE)
01832 #define EG_LINES_XFERRED         EMAPI(EDTG_LINES_XFERRED)
01833 #define ES_PROCESS_ISR         EMAPI(EDTS_PROCESS_ISR)
01834 #define ES_CLEAR_DMAID         EMAPI(EDTS_CLEAR_DMAID)
01835 #define ES_DRV_BUFFER_LEAD        EMAPI(EDTS_DRV_BUFFER_LEAD)
01836 #define EG_SERIAL_WRITE_AVAIL        EMAPI(EDTG_SERIAL_WRITE_AVAIL)
01837 #define ES_USER_DMA_WAKEUP        EMAPI(EDTS_USER_DMA_WAKEUP)
01838 #define EG_USER_DMA_WAKEUP        EMAPI(EDTG_USER_DMA_WAKEUP)
01839 #define EG_WAIT_STATUS        EMAPI(EDTG_WAIT_STATUS)
01840 #define ES_WAIT_STATUS        EMAPI(EDTS_WAIT_STATUS)
01841 #define ES_TIMEOUT_OK        EMAPI(EDTS_TIMEOUT_OK)
01842 #define EG_TIMEOUT_OK        EMAPI(EDTG_TIMEOUT_OK)
01843 #define ES_MULTI_DONE        EMAPI(EDTS_MULTI_DONE)
01844 #define EG_MULTI_DONE        EMAPI(EDTG_MULTI_DONE)
01845 #define ES_TEST_LOCK_ON        EMAPI(EDTS_TEST_LOCK_ON)
01846 #define EG_FVAL_LOW        EMAPI(EDTG_FVAL_LOW)
01847 #define ES_MEZZ_BITPATH      EMAPI(EDTS_MEZZ_BITPATH)
01848 #define EG_MEZZ_BITPATH      EMAPI(EDTG_MEZZ_BITPATH)
01849 #define EG_DMA_INFO          EMAPI(EDTG_DMA_INFO)
01850 #define ES_USER_FUNC         EMAPI(EDTS_USER_FUNC)
01851 #define ES_TEST_STATUS         EMAPI(EDTS_TEST_STATUS)
01852 #define ES_KERNEL_ALLOC         EMAPI(EDTS_KERNEL_ALLOC)
01853 #define EG_RESERVED_PAGES       EMAPI(EDTG_RESERVED_PAGES)
01854 #define ES_RAW_SGLIST            EMAPI(EDTS_RAW_SGLIST)
01855 #define ES_IGNORE_SIGNALS            EMAPI(EDTS_IGNORE_SIGNALS)
01856 #define ES_TRACE_REG            EMAPI(EDTS_TRACE_REG)
01857 #define ES_TIMESTAMP_LEVEL            EMAPI(EDTS_TIMESTAMP_LEVEL)
01858 #define ES_REG_BIT_CLEARSET            EMAPI(EDTS_REG_BIT_CLEARSET)
01859 #define ES_REG_BIT_SETCLEAR            EMAPI(EDTS_REG_BIT_SETCLEAR)
01860 #define ES_REG_READBACK                EMAPI(EDTS_REG_READBACK)
01861 #define ES_MEZZ_ID                EMAPI(EDTS_MEZZ_ID)
01862 #define EG_MEZZ_ID                EMAPI(EDTG_MEZZ_ID)
01863 #define EG_NUMBUFS                EMAPI(EDTG_NUMBUFS)
01864 #define ES_READ_STARTACT        EMAPI(EDTS_READ_STARTACT)
01865 #define ES_READ_ENDACT          EMAPI(EDTS_READ_ENDACT)
01866 #define ES_WRITE_STARTACT       EMAPI(EDTS_WRITE_STARTACT)
01867 #define ES_WRITE_ENDACT         EMAPI(EDTS_WRITE_ENDACT)
01868 #define ES_READ_START_DELAYS    EMAPI(EDTS_READ_START_DELAYS)
01869 #define ES_READ_END_DELAYS      EMAPI(EDTS_READ_END_DELAYS)
01870 #define ES_WRITE_START_DELAYS   EMAPI(EDTS_WRITE_START_DELAYS)
01871 #define ES_WRITE_END_DELAYS     EMAPI(EDTS_WRITE_END_DELAYS)
01872 #define ES_INDIRECT_REG_BASE    EMAPI(EDTS_INDIRECT_REG_BASE)
01873 #define EG_INDIRECT_REG_BASE    EMAPI(EDTG_INDIRECT_REG_BASE)
01874 #define ES_BITLOAD              EMAPI(EDTS_BITLOAD)
01875 #define ES_MEZZLOAD             EMAPI(EDTS_MEZZLOAD)
01876 #define ES_PCILOAD              EMAPI(EDTS_PCILOAD)
01877 
01878 
01879 #define ES_INTR_MASK              EMAPI(EDTS_INTR_MASK)
01880 #define EG_INTR_MASK              EMAPI(EDTG_INTR_MASK)
01881 
01882 /* MUST BE EQUAL AT LEAST ONE GREATER THAN THE HIGHEST EDT IOCTL ABOVE */
01883 #define MIN_PCI_IOCTL 200
01884 #define PCIIOC(action, type, size) EIOC(action+MIN_PCI_IOCTL, type, size)
01885 
01886 /* signals for pcd */
01887 #define  PCD_STAT1_SIG      1
01888 #define  PCD_STAT2_SIG      2
01889 #define  PCD_STAT3_SIG      3
01890 #define  PCD_STAT4_SIG      4
01891 #define  PCD_STATX_SIG      5
01892 
01893 /* signals for p16d */
01894 #define P16_DINT_SIG        1
01895 
01896 /* signals for p11w */
01897 #define P11_ATT_SIG     1
01898 #define P11_CNT_SIG     2
01899 
01900 /* signals for p53b */
01901 #define P53B_SRQ_SIG       1
01902 #define P53B_INTERVAL_SIG  2
01903 #define P53B_MODECODE_SIG  3
01904 
01905 #define ID_IS_PCD(id) ((id == PCD20_ID) \
01906                         || (id == PCD40_ID) \
01907                         || (id == PCD60_ID) \
01908                         || (id == PGP20_ID) \
01909                         || (id == PGP40_ID) \
01910                         || (id == PGP60_ID) \
01911                         || (id == PGP_ECL_ID) \
01912                         || (id == PCDFCI_SIM_ID) \
01913                         || (id == PCDFCI_PCD_ID) \
01914                         || (id == PSS4_ID) \
01915                         || (id == PSS16_ID) \
01916                         || (id == PCDA_ID) \
01917                         || (id == PCDCL_ID) \
01918                         || (id == PCDA16_ID) \
01919                         || (id == PCD_16_ID) \
01920                         || (id == PCDFOX_ID) \
01921                         || (id == PGS4_ID) \
01922                         || (id == PGS16_ID) \
01923                         || (id == PE8LX1_ID) \
01924                         || (id == PE8LX16_LS_ID) \
01925                         || (id == PE8LX16_ID) \
01926                         || (id == PE8LX64_ID) \
01927                         || (id == PE4AMC16_ID) \
01928                         || (id == PGP_THARAS_ID))
01929 
01930 #define ID_IS_SS(id) ((id == PSS4_ID) \
01931                         || (id == PSS16_ID)) 
01932 
01933 #define ID_IS_GS(id) ((id == PGS4_ID) \
01934                         || (id == PGS16_ID)) 
01935 
01936 #define ID_IS_LX(id) ((id == PE8LX1_ID) \
01937                         || (id == PE8LX16_LS_ID) \
01938                         || (id == PE4AMC16_ID) \
01939                         || (id == PE8LX16_ID) \
01940                         || (id == PE8LX64_ID))
01941 
01942 #define ID_IS_PDV(id) ((id == PDV_ID) \
01943                         || (id == PDVK_ID) \
01944                         || (id == PDV44_ID) \
01945                         || (id == PDVAERO_ID) \
01946                         || (id == PDVCL_ID) \
01947                         || (id == PE4DVCL_ID) \
01948                         || (id == PE8DVCL_ID) \
01949                         || (id == PE8DVCLS_ID) \
01950                         || (id == PDVCL2_ID) \
01951                         || (id == PDVFOI_ID) \
01952                         || (id == PDVFCI_AIAG_ID) \
01953                         || (id == PDVFCI_USPS_ID) \
01954                         || (id == PDVA_ID) \
01955                         || (id == PDVFOX_ID) \
01956                         || (id == PE4DVFOX_ID) \
01957                         || (id == PE8DVFOX_ID) \
01958                         || (id == PDVA16_ID) \
01959                         || (id == PGP_RGB_ID) \
01960                         || (id == PE4DVFCI_ID) \
01961                         || (id == PE8DVFCI_ID))
01962 
01963 #define ID_IS_DVFOX(id) ((id == PDVFOX_ID) \
01964                         || (id == PE4DVFOX_ID) \
01965                         || (id == PE8DVFOX_ID))
01966 
01967 #define ID_IS_DVCL(id)  ((id == PDVCL_ID) \
01968                         || (id == PE4DVCL_ID) \
01969                         || (id == PE8DVCL_ID))
01970 
01971 #define ID_IS_DVCL2(id) ((id == PDVCL2_ID) \
01972                         || (id == PE8DVCLS_ID)) /* ALERT: we're going with distinct ID for PCIe CLS */
01973                                                 /* so removed IDs for those boards as of 4.2.4.5 */
01974 
01975 
01976 #define ID_HAS_MEZZ(id) (ID_IS_SS(id) || ID_IS_GS(id) || ID_IS_LX(id))
01977 
01982 #define edt_is_pdv(edt_p) (ID_IS_PDV(edt_p->devid))
01983 #define edt_is_pcd(edt_p) (ID_IS_PCD(edt_p->devid))
01984 #define edt_is_dvfox(edt_p) (ID_IS_DVFOX(edt_p->devid))
01985 #define edt_is_dvcl(edt_p) (ID_IS_DVCL(edt_p->devid))
01986 #define edt_is_dvcl2(edt_p) (ID_IS_DVCL2(edt_p->devid))
01987 
01988 #define edt_is_dv_multichannel(edt_p) (edt_is_dvcl(edt_p) || edt_is_dvfox(edt_p) || edt_p->devid == PDVAERO_ID)
01989  /* end dma_utility */
01991  /* end weakgroup dma */
01993 
01994 /* definition for header data for buffers */
01995 /* for disk I/O speed, header mem may be allocated with ring-buffer memory 
01996    even if header not in the DMA stream. This covers all possible relationships
01997    of header info to acquisition info */
01998 
01999 #ifndef HDR_TYPE_IRIG1
02000 
02001 /* defined types of within-dma header data */
02002 #define HDR_TYPE_IRIG1           1
02003 #define HDR_TYPE_FRAMECNT        2
02004 #define HDR_TYPE_IRIG2           3
02005 #define HDR_TYPE_BUFHEADER       4 /* fro general data (wrap) */
02006 
02007 #endif
02008 
02009 #endif /* INCLUDE_edtlib_h */

Generated on Mon Mar 21 14:14:47 2011 by  doxygen 1.4.7