From bb1a6c38783c2429edcaf4a6dcb96cc44676b645 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Wed, 26 Aug 1992 12:39:44 +0000 Subject: [PATCH] Support new I/O event scanning --- src/drv/drvAb.c | 6 ++++-- src/drv/drvAt5Vxi.c | 28 +++++++++++++++++++++++++++- src/drv/drvDvx.c | 29 ++++++++++++++++++++++++++++- src/drv/drvHpe1368a.c | 29 +++++++++++++++++++++++++++++ src/drv/drvKscV215.c | 29 +++++++++++++++++++++++++++++ src/drv/drvXy240.c | 34 ++++++++++++++++++++++++++++++++-- 6 files changed, 149 insertions(+), 6 deletions(-) diff --git a/src/drv/drvAb.c b/src/drv/drvAb.c index 186344ec6..bf7d74ad9 100644 --- a/src/drv/drvAb.c +++ b/src/drv/drvAb.c @@ -465,6 +465,9 @@ unsigned short ab_btq_cnt[AB_MAX_LINKS][AB_MAX_ADAPTERS][AB_MAX_CARDS]; #ifndef EPICS_V2 #include static IOSCANPVT ioscanpvt[AB_MAX_LINKS][AB_MAX_ADAPTERS][AB_MAX_CARDS]; +#else +extern short wakeup_init; /* flags that the database scan initialization is complete */ +#define interruptAccept wakeup_init #endif /* @@ -1122,7 +1125,6 @@ abDoneTask(){ * * simulate a change of state interrupt from the Allen-Bradley */ -extern short wakeup_init; /* flags that the database scan initialization is complete */ unsigned char ab_old_binary_ins[AB_MAX_LINKS*AB_MAX_ADAPTERS*AB_MAX_CARDS]; ab_bi_cos_simulator() { @@ -1136,7 +1138,7 @@ ab_bi_cos_simulator() first_scan_complete = first_scan = 0; for(;;){ /* flag first scan */ - if (wakeup_init && !first_scan_complete) first_scan = 1; + if (interruptAccept && !first_scan_complete) first_scan = 1; /* check each link */ link = 0; diff --git a/src/drv/drvAt5Vxi.c b/src/drv/drvAt5Vxi.c index 0457d737b..2fb12dcc6 100644 --- a/src/drv/drvAt5Vxi.c +++ b/src/drv/drvAt5Vxi.c @@ -1,4 +1,4 @@ -/* at5vxi_driver.c */ +/* drvVxiAt5.c */ /* share/src/drv @(#) $Id$ */ /* @@ -54,6 +54,7 @@ * .15 joh 072992 print more raw values in io report * .16 joh 081092 merged at5vxi_models.h into this source * .17 joh 081992 function name change + * .17 mrk 082692 Added support for new I/O event scanning * * Notes: * ------ @@ -111,6 +112,9 @@ #include #include #include +#ifndef EPICS_V2 +#include +#endif static char SccsId[] = "$Id$\t$Date$"; @@ -341,6 +345,9 @@ struct at5vxi_config{ char mdt; /* modified data tag */ struct vxi_csr *pcsr; /* vxi device hdr ptr */ struct at5vxi_dd *pdd; /* at5 device dep ptr */ +#ifndef EPICS_V2 + IOSCANPVT ioscanpvt; +#endif }; LOCAL unsigned long at5vxiDriverID; @@ -515,6 +522,9 @@ unsigned addr; pc->pdd = (struct at5vxi_dd *) &pc->pcsr->dir.r.dd; FASTLOCKINIT(&pc->lock); +#ifndef EPICS_V2 + scanIoInit(&pc->ioscanpvt); +#endif /* * revert to power up control @@ -679,8 +689,12 @@ int addr; * wake up the I/O event scanner */ { +#ifdef EPICS_V2 io_scanner_wakeup(IO_AI, VXI_AT5_AI, addr); io_scanner_wakeup(IO_BI, VXI_AT5_BI, addr); +#else + scanIoRequest(pconfig->ioscanpvt); +#endif } /* @@ -1282,7 +1296,19 @@ register unsigned long *prval; return OK; } + +#ifndef EPICS_V2 +at5vxi_getioscanpvt(card,scanpvt) +unsigned short card; +IOSCANPVT *scanpvt; +{ + register struct at5vxi_config *pconfig; + pconfig = AT5VXI_PCONFIG(card); + if(pconfig) *scanpvt = pconfig->ioscanpvt; + return(0); +} +#endif /* * diff --git a/src/drv/drvDvx.c b/src/drv/drvDvx.c index 336c50506..7e7c40abf 100644 --- a/src/drv/drvDvx.c +++ b/src/drv/drvDvx.c @@ -83,6 +83,7 @@ * JH 08/03/92 moved interrupt vector base to module_types.h * JH 08/05/92 dvx driver init is called from drvDvx now * JH 08/10/92 merged dvx private include file into this source + * MRK 08/26/92 Added support for new I/O event scanning */ static char *SccsId = "$Id$\t$Date$"; @@ -93,6 +94,9 @@ static char *SccsId = "$Id$\t$Date$"; #include #include #include +#ifndef EPICS_V2 +#include +#endif /* general constants */ #define DVX_ID 0xCFF5 /* analogic ID code */ @@ -167,6 +171,9 @@ struct dvx_rec int int_vector; /* interrupt vector */ int intcnt; /* interrupt count # */ int cnum; /* card number */ +#ifndef EPICS_V2 + IOSCANPVT ioscanpvt; +#endif }; /* dma chain table size */ @@ -294,7 +301,11 @@ dvx_int(dvxptr) cptr->dma_point = DMA_CSR; cptr->dma_data = CMR_SC | M_CIE | M_CH2; /* enable int channel #2 */ cptr->dma_data = CMR_START | M_CH2; /* start channel #2 */ +#ifdef EPICS_V2 io_scanner_wakeup(IO_AI,DVX2502,dvxptr->cnum); /*update database records */ +#else + scanIoRequest(dvxptr->ioscanpvt); +#endif break; } cptr->csr = dvxptr->csr_shadow; @@ -405,6 +416,9 @@ long dvx_driver_init() dvx[i].csr_shadow |= CSR_M_ESTART; /* enable ext start (shadow csr) */ ptr->csr = dvx[i].csr_shadow; /* enable external start */ dvx[i].mode = RUN_MODE; /* ready to aquire data */ +#ifndef EPICS_V2 + scanIoInit(&dvx[i].ioscanpvt); +#endif } else dvx[i].pdvx2502 = 0; @@ -571,7 +585,20 @@ dvx_dump(card,firstchan,lastchan) } printf("end of list\n"); } - + +#ifndef EPICS_V2 +dvx_getioscanpvt(card,scanpvt) +short card; +IOSCANPVT *scanpvt; +{ + if ((card >= ai_num_cards[DVX2502]) || (card < 0)) /* make sure hardware exists */ + return(0); + else if (dvx[card].pdvx2502 == 0) + return(0); + *scanpvt = dvx[card].ioscanpvt; + return(0); +} +#endif /* * diff --git a/src/drv/drvHpe1368a.c b/src/drv/drvHpe1368a.c index 1d008433b..b1c61c702 100644 --- a/src/drv/drvHpe1368a.c +++ b/src/drv/drvHpe1368a.c @@ -31,6 +31,7 @@ * ----------------- * .01 071792 joh Added model name registration * .02 081992 joh vxiUniqueDriverID -> epvxiUniqueDriverID + * .03 082692 mrk Added support for new I/O event scanning * */ @@ -46,6 +47,9 @@ #include #include #include +#ifndef EPICS_V2 +#include +#endif #define VXI_MODEL_HPE1368A (0xf28) @@ -63,6 +67,9 @@ struct hpe1368a_config{ unsigned short pending; /* switch position pending int */ unsigned short shadow; /* shadow of actual switch pos */ int busy; /* relays active */ +#ifndef EPICS_V2 + IOSCANPVT ioscanpvt; +#endif }; #define HPE1368A_INT_LEVEL 1 @@ -152,6 +159,9 @@ unsigned la; ChannelEnable(pcsr) = ALL_SWITCHES_OPEN; FASTLOCKINIT(&pc->lock); +#ifndef EPICS_V2 + scanIoInit(&pc->ioscanpvt); +#endif r0 = intConnect( (unsigned char) INUM_TO_IVEC(la), @@ -209,7 +219,11 @@ unsigned la; /* * tell them that the switches have settled */ +#ifdef EPICS_V2 io_scanner_wakeup(IO_BI, HPE1368A_BI, la); +#else + scanIoRequest(pc->ioscanpvt); +#endif } @@ -243,6 +257,21 @@ int level; } + + +#ifndef EPICS_V2 +hpe1368a_getioscanpvt(la,scanpvt) +unsigned short la; +IOSCANPVT *scanpvt; +{ + struct hpe1368a_config *pc; + + pc = HPE1368A_PCONFIG(la); + if(pc != NULL) *scanpvt = pc->ioscanpvt; + return(0); +} +#endif + /* * diff --git a/src/drv/drvKscV215.c b/src/drv/drvKscV215.c index 21d395864..29bfabdd0 100644 --- a/src/drv/drvKscV215.c +++ b/src/drv/drvKscV215.c @@ -1,3 +1,5 @@ +/* drvKscV215.c*/ +/* share/src/drv @(#) $Id$ */ /* * KscV215_driver.c * @@ -31,6 +33,7 @@ * ----------------- * .01 071792 joh Added model name registration * .02 081992 joh vxiUniqueDriverID -> epvxiUniqueDriverID + * .03 082692 mrk Added support for new I/O event scanning * */ @@ -46,6 +49,9 @@ #include #include #include +#ifndef EPICS_V2 +#include +#endif #define VXI_MODEL_KSCV215 (0x215) @@ -61,6 +67,9 @@ epvxiPConfig((LA), KscV215DriverId, struct KscV215_config *) struct KscV215_config{ FAST_LOCK lock; /* mutual exclusion */ +#ifndef EPICS_V2 + IOSCANPVT ioscanpvt; +#endif }; #define KSCV215_INT_LEVEL 1 @@ -216,6 +225,9 @@ unsigned la; } FASTLOCKINIT(&pc->lock); +#ifndef EPICS_V2 + scanIoInit(&pc->ioscanpvt); +#endif #ifdef INTERRUPTS status = intConnect( @@ -304,7 +316,11 @@ unsigned la; /* * tell them that the switches have settled */ +#ifdef EPICS_V2 io_scanner_wakeup(IO_AI, KSCV215_BI, la); +#else + scanIoRequest(pc->ioscanpvt); +#endif } #endif @@ -419,3 +435,16 @@ register unsigned short *prval; return ERROR; } + +#ifndef EPICS_V2 +KscV215_at5vxi_getioscanpvt(la,scanpvt) +unsigned short la; +IOSCANPVT *scanpvt; +{ + struct KscV215_config *pc; + + pc = KSCV215_PCONFIG(la); + if(pc != NULL) *scanpvt = pc->ioscanpvt; + return(0); +} +#endif diff --git a/src/drv/drvXy240.c b/src/drv/drvXy240.c index 6f36ee37b..2d170bc95 100644 --- a/src/drv/drvXy240.c +++ b/src/drv/drvXy240.c @@ -37,6 +37,7 @@ * .04 08-11-92 joh now allows for runtime reconfiguration of * the addr map * .05 08-25-92 mrk added DSET; made masks a macro + * .06 08-26-92 mrk support epics I/O event scan */ #include "vxWorks.h" @@ -44,6 +45,15 @@ #include "vme.h" #include "module_types.h" #include +#ifndef EPICS_V2 +#include +#include +#else +extern short wakeup_init; /* flags that the database scan initialization i +s complete */ +#define interruptAccept wakeup_init +#endif + static long report(); static long init(); @@ -98,6 +108,9 @@ struct dio_rec short mode; /*operating mode*/ unsigned short sport0_1; /*saved inputs*/ unsigned short sport2_3; /*saved inputs*/ +#ifndef EPICS_V2 + IOSCANPVT ioscanpvt; +#endif /*short dio_vec;*/ /*interrupt vector*/ /*unsigned int intr_num;*/ /*interrupt count*/ }; @@ -129,7 +142,6 @@ dio_int(ptr) *task to check for change of state * */ - extern int wakeup_init; dio_scan() { @@ -139,7 +151,7 @@ dio_scan() first_scan = first_scan_complete = 0; for (;;) { - if (wakeup_init & !first_scan_complete) first_scan = 1; + if (interruptAccept & !first_scan_complete) first_scan = 1; for (i = 0; i < XY240_MAX_CARDS; i++) { @@ -149,7 +161,11 @@ dio_scan() || first_scan) { /* printf("io_scanner_wakeup for card no %d\n",i); */ +#ifdef EPICS_V2 io_scanner_wakeup(IO_BI,XY240_BI,i); +#else + scanIoRequest(dio[i].ioscanpvt); +#endif dio[i].sport0_1 = dio[i].dptr->port0_1; dio[i].sport2_3 = dio[i].dptr->port2_3; } @@ -203,6 +219,9 @@ register initialization pdio_xy240->flg_dir = 0xf0; /*ports 0-3,input;ports 4-7,output*/ dio[i].sport2_3 = pdio_xy240->port2_3; /*read and save high values*/ dio[i].dptr = pdio_xy240; +#ifndef EPICS_V2 + scanIoInit(&dio[i].ioscanpvt); +#endif } else{ @@ -220,6 +239,17 @@ register initialization return(0); } +#ifndef EPICS_V2 +xy240_bi_getioscanpvt(card,scanpvt) +unsigned short card; +IOSCANPVT *scanpvt; +{ + if ((card >= XY240_MAX_CARDS) || (!dio[card].dptr)) return(0); + *scanpvt = dio[card].ioscanpvt; + return(0); +} +#endif + /* * XY240_BI_DRIVER *