Xycom Xy010 is prehistoric.

Bitbus driver was unbundled some time back.
The drvBitBus*.h files are needed for building drvGpib, and have been
updated to the latest unbundled versions.
This commit is contained in:
Andrew Johnson
2004-04-05 21:51:15 +00:00
parent 5bbf333ad3
commit 565ec952fe
6 changed files with 15 additions and 3419 deletions

View File

@@ -21,21 +21,10 @@ else
USR_CFLAGS = -fshared-data -fvolatile
endif
#The following have been unbundled. DONT USE THESE
#INC += drvBB232.h
INC += drvBitBus.h
# These two Bitbus files are needed to build the GPIB support. However the
# bitbus driver source has now been unbundled and removed from Base.
INC += drvBitBusErr.h
#INC += drvMsg.h
#drvBitBus and include files APPEARS HERE AND IN UNBUNDLED - BIG PROBLEM
INC += drvBitBusInterface.h
#SRCS.c += ../drvBB232.c
SRCS.c += ../drvBitBus.c
#SRCS.c += ../drvMsg.c
#SRCS.c += ../drvTranServ.c
#The following have not been used
#INC += drvRs232.h
#INC += drvTy232.h
INC += drvGpib.h
INC += drvGpibErr.h
@@ -45,7 +34,6 @@ INC += drvJgvtr1.h
INC += drvOms.h
INC += steppermotor.h
SRCS.c += ../module_types.c
SRCS.c += ../drvBb902.c
SRCS.c += ../drvBb910.c
@@ -58,7 +46,6 @@ SRCS.c += ../drvGpib.c
SRCS.c += ../drvJgvtr1.c
SRCS.c += ../drvOms.c
SRCS.c += ../drvVmi4100.c
SRCS.c += ../drvXy010.c
SRCS.c += ../drvXy210.c
SRCS.c += ../drvXy220.c
SRCS.c += ../drvXy240.c

File diff suppressed because it is too large Load Diff

View File

@@ -1,279 +0,0 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef EPICS_DRVBITBUS_H
#define EPICS_DRVBITBUS_H
/* #define BB_SUPER_DEBUG */
/*
* Author: John Winans
* Date: 09-10-91
* BitBus driver
*/
/*****************************************************************************
*
* This history stuff below is used to save the recent history of operation.
* This history includes dumps of messages that are queued, transmitted and
* received. This information is saved along with the relative tick time.
*
*****************************************************************************/
#ifdef BB_SUPER_DEBUG
#define BB_SUPER_DEBUG_HIST_SIZ 50 /* How many messages to save */
typedef struct XactHistStruct
{
struct dpvtBitBusHead Xact; /* BB message operated on */
unsigned long Time; /* getTick() when operated on */
int State; /* What was being done to the message */
} XactHistStruct;
#define XACT_HIST_STATE_QUEUE 0 /* Some task queued a transaction */
#define XACT_HIST_STATE_TX 1 /* Transmitter sent a transaction */
#define XACT_HIST_STATE_RX 2 /* Receiver received a response */
#define XACT_HIST_STATE_WD_TIMEOUT 3 /* Watchdog times out a transaction */
#define XACT_HIST_STATE_RESET 4 /* No message... link was reset */
#define XACT_HIST_STATE_RX_UNSOLICITED 5 /* RX'd message not solicited */
#define XACT_HIST_STATE_RX_ABORT 6 /* RX task got a link about status */
#define XACT_HIST_STATE_TX_ABORT 7 /* TX task got a link about status */
#define XACT_HIST_STATE_RX_URCMD 8 /* RX task got unsolicited RCMD */
#define XACT_HIST_STATE_TX_RESET 9 /* TX task got a link about status */
#define XACT_HIST_STATE_TX_STUCK 10 /* TX fifo is stuck on the 8044 */
/* One of these is allocated for each bitbus link */
typedef struct HistoryStruct
{
SEM_ID sem; /* Use when 'making' history */
XactHistStruct Xact[BB_SUPER_DEBUG_HIST_SIZ];
int Next; /* Next history slot to use */
unsigned long Num; /* Total history messages */
} HistoryStruct;
static int BBSetHistEvent(int link, struct dpvtBitBusHead *pXact, int State);
#endif
/******************************************************************************
*
* The BUSY/IDLE notion is used to count the number of outstanding
* messages for a specific node. The idea is that up to BUSY messages
* can be sent to a node before waiting before deciding not to send any more.
* According to the BitBus specs, this value is 7. However, it also
* states that responses can come back out of order. If this is even true
* for messages sent to the SAME TASK ON THE SAME NODE, the received messages
* CAN NOT be routed back to their initiators properly. Because the node#
* and task# is all we have to identify what a response message is for,
* I am limiting the per-node maximum to 1.
*
******************************************************************************/
#define BB_BUSY 1 /* deviceStatus value if device is currently busy */
#define BB_IDLE 0 /* deviceStatus value if device is currently idle */
/******************************************************************************
*
* This list structure is used in the bitbus driver to represent its queues.
*
******************************************************************************/
struct bbList {
struct dpvtBitBusHead *head; /* head of the linked list */
struct dpvtBitBusHead *tail; /* tail of the linked list */
int elements; /* holds number of elements on the list */
SEM_ID sem; /* semaphore for the queue list */
};
/*****************************************************************************
* Memory Map of XVME-402 BITBUS CARD
*
* This board is rather stupid in that it wastes a whole Kilo of space
* for its 5 1-byte regs. So the dm* fields in the structure below are
* for those filler locations.
*
*****************************************************************************/
typedef struct XycomBBRegsStruct {
unsigned char dm0;
unsigned char stat_ctl;
unsigned char dm2;
unsigned char int_vec;
unsigned char dm4;
unsigned char data;
unsigned char dm6;
unsigned char cmnd;
unsigned char dm8;
unsigned char fifo_stat;
unsigned char dmA[1014]; /* Board occupies 1024 bytes in memory*/
} XycomBBRegsStruct;
#define XYCOM_BB_MAX_OUTSTAND_MSGS 4 /* per-link max pending messages */
#define RESET_POLL_TIME 10 /* time to sleep when waiting on a link abort */
#define BB_SEND_CMD 0x0 /* command to initiate sending of msg */
#define XVME_ENABLE_INT 0x08 /* Allow xvme interupts */
#define XVME_TX_INT 0x20 /* int enable TX only */
#define XVME_TX_PEND 0x10 /* transmit interrupt currently pending */
#define XVME_RX_INT 0x80 /* int exable RX only */
#define XVME_RX_PEND 0x40 /* receive interrupt currently pending */
#define XVME_NO_INT 0 /* disable all interrupts */
/******************************************************************************
*
* Fifo status register format for Xycom board
*
* +----+----+----+----+----+----+----+----+
* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Bits
* +----+----+----+----+----+----+----+----+
* "1" "1" RCMD RFNE "1" "1" "1" TFNF data
*
* RCMD = "1"= command received ( end of message )
* "0"= No command
*
* RFNE = "1" = Receive Fifo Not Empty
* "0" = Receive Fifo empty
*
* TFNF = "1" = Transmit Fifo Not Full
* "0" = transmit fifo full
*
* NOTE:
* A write to bit 7 of the Fifo status register can be used to reset the
* xvme board.
*
*****************************************************************************/
#define XVME_RCMD 0x20 /* Command has been received */
#define XVME_RFNE 0x10 /* Receive Fifo is Not Empty */
#define XVME_TFNF 0x01 /* Transmit FIFO is Not Full */
#define XVME_FSVALID 0x31 /* these are the only valid status bits */
#define XVME_FSIDLE 0x01 /* fifo_stat & FSVALID = 0x1 when it is idle */
#define XVME_RESET 0x80 /* Write this and you reset the XVME card */
/******************************************************************************
*
* The XycomBBLinkStruct structure holds all the xvme-card specific data
* required for the operation of the link.
*
******************************************************************************/
typedef struct XycomBBLinkStruct {
volatile XycomBBRegsStruct *bbRegs;/* pointer to board registers */
SEM_ID rxInt; /* given when rx interrupts occur */
} XycomBBLinkStruct;
/****************************************************************************
* Memory Map of PEP Modular PB-BIT BITBUS CARD
*
* This board is rather stupid in that it wastes a bunch of bytes
* for its regs. So the dm* fields in the structure below are
* for those filler locations.
*
***************************************************************************/
typedef struct PepBBRegsStruct {
unsigned char dm0;
unsigned char data;
unsigned char dm2;
unsigned char stat_ctl;
unsigned char dm[29];
unsigned char int_vec;
} PepBBRegsStruct;
/******************************************************************************
*
* status register format for PEP's PB-BIT board
*
* +----+----+----+----+----+----+----+----+
* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Bits
* +----+----+----+----+----+----+----+----+
* X X X STF LBP TFF RFNE IRQP
*
* STF = "1"= self-test failed
* "0"= passed
*
* LBP = "1"= last data byte was last of package
* "0"= 1+ bytes left
*
* TFF = "1"= only one more byte may be written to TFIFO
* "0"= 1+ more bytes may be written
*
* RFNE = "1"= Receive Fifo Not Empty
* "0"= Receive Fifo empty
*
* IRQP = "1"= no irq pending
* "0"= irq pending
*
*
*****************************************************************************/
#define PEP_BB_RCMD 0x08 /* Command has been received */
#define PEP_BB_RFNE 0x02 /* Receive Fifo is Not Empty */
#define PEP_BB_TFNF 0x04 /* Transmit FIFO is Not Full */
#define PEP_BB_FSVALID 0x1f /* these are the only valid status bits */
/******************************************************************************
*
* The PepBBLinkStruct structure holds all the card specific data required for
* the operation of the link.
*
******************************************************************************/
typedef struct PepBBLinkStruct {
volatile PepBBRegsStruct *bbRegs; /* pointer to board registers */
SEM_ID rxInt; /* given when rx interrupts occur */
} PepBBLinkStruct;
/*****************************************************************************
*
* Holds the user-configured board addresses etc. These MUST be set before
* the driver is initialized. And may not be changed after the init phase.
*
* NOTE:
* The setting of these items is intended to be done via records in the future.
*
* The busyList.sem is used to lock the busyList as well as the deviceStatus
* table.
*
*****************************************************************************/
typedef struct BitbusLinkStruct
{
unsigned long LinkType; /* Type of link (XYCOM, PEP,...) */
unsigned long BaseAddr; /* Base address within A16 */
unsigned long IrqVector; /* Irq vector base */
unsigned long IrqLevel; /* Irq level */
WDOG_ID watchDogId; /* watchdog for timeouts */
SEM_ID watchDogSem; /* set by the watch dog int handler */
unsigned char abortFlag; /* set to 1 if link is being reset by the dog */
unsigned char txAbortAck; /* set to 1 by txTask to ack abort Sequence */
unsigned char rxAbortAck; /* set to 1 by rxTask to ack abort Sequence */
int nukeEm; /* manual link restart flag */
SEM_ID linkEventSem; /* given when this link requires service */
struct bbList queue[BB_NUM_PRIO]; /* prioritized request queues */
struct bbList busyList; /* messages waiting on a response */
unsigned char deviceStatus[BB_APERLINK];/* mark a device as idle or busy */
unsigned long syntheticDelay[BB_APERLINK]; /* holds the wakeup time for 91-delays */
int DelayCount; /* holds total number of syntheticDelays in progress */
union
{
PepBBLinkStruct PepLink;
XycomBBLinkStruct XycomLink;
} l;
#ifdef BB_SUPER_DEBUG
HistoryStruct History;
#endif
} BitbusLinkStruct;
#define BB_CONF_HOSED 0 /* Link is not present */
#define BB_CONF_TYPE_XYCOM 1 /* Link is a Xycom board */
#define BB_CONF_TYPE_PEP 2 /* Link is a PEP board */
#endif

View File

@@ -7,7 +7,9 @@
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* share/src/drv/drvBitBusErr.h $Id$ */
/* $Id$ */
/* Author: John Winans
* Date: 12-5-91
*/

View File

@@ -7,8 +7,9 @@
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* drvBitBusInterface.h */
/* share/src/drv %W% %G% */
/* Author: John Winans
* Date: 09-10-91
*/
@@ -85,56 +86,6 @@ struct dpvtBitBusHead {
#define BB_NONODE 2 /* transmit message to non-existant node */
#define BB_TIMEOUT 3 /* response took too long from node */
#if 0 /* JRW moved to drvBitbus.h */
/******************************************************************************
*
* The BUSY/IDLE notion is used to count the number of outstanding
* messages for a specific node. The idea is that up to BUSY messages
* can be sent to a node before waiting before deciding not to send any more.
* According to the BitBus specs, this value is 7. However, it also
* states that responses can come back out of order. If this is even true
* for messages sent to the SAME TASK ON THE SAME NODE, the received messages
* CAN NOT be routed back to their initiators properly. Because the node#
* and task# is all we have to identify what a response message is for,
* I am limiting the per-node maximum to 1.
*
******************************************************************************/
#define BB_BUSY 1 /* deviceStatus value if device is currently busy */
#define BB_IDLE 0 /* deviceStatus value if device is currently idle */
struct bbList {
struct dpvtBitBusHead *head; /* head of the linked list */
struct dpvtBitBusHead *tail; /* tail of the linked list */
int elements; /* holds number of elements on the list */
SEM_ID sem; /* semaphore for the queue list */
};
/******************************************************************************
*
* The bbLink structure holds all the required link-specific queueing
* information.
*
******************************************************************************/
struct bbLink {
int linkType; /* the type of link (defined in link.h) */
int linkId; /* the link number of this structure */
int nukeEm; /* manual link restart flag */
SEM_ID linkEventSem; /* given when this link requires service */
struct bbList queue[BB_NUM_PRIO]; /* prioritized request queues */
/*
* In order to modify either the busyList entries or the deviceStatus
* table, the busyList.sem MUST be held first.
*/
struct bbList busyList; /* messages waiting on a response */
unsigned char deviceStatus[BB_APERLINK];/* mark a device as idle or busy */
};
#endif
#define BB_STANDARD_TX_ROUTE 0x40 /* Route value for TX message */
#define BB_RAC_TASK 0x00 /* RAC task ID */
@@ -160,7 +111,7 @@ struct bbIdWord {
unsigned int taskMods; /* One of BB_MOD_* */
unsigned int revCode; /* Revision code number of the BUG's code */
};
/******************************************************************************
*
* List of GPIB command definitions (defined by the GPIB-BUG interface spec)
@@ -169,7 +120,7 @@ struct bbIdWord {
#define BB_232_CMD 0x60 /* or'd with the port number */
#define DD_232_PORT 0x1F /* port number is lowest 5 bits */
#define BB_232_BREAK 0x40 /* or'd with the port number */
/******************************************************************************
*
* List of GPIB command definitions (defined by the GPIB-BUG interface spec)
@@ -206,7 +157,7 @@ struct bbIdWord {
#define BB_IBSTAT_EOI 0x20
#define BB_IBSTAT_SRQ 0x10
#define BB_IBSTAT_TMO 0x01
/******************************************************************************
*
* Partial List of RAC Command Definitions (defined in BitBus Specification)
@@ -251,5 +202,9 @@ struct bbIdWord {
#define BB_RAC_PROTECTED 0x95
#define BB_UNKNOWN_RAC_CMND 0x96
#endif
/* A couple of routine definitions */
int BBConfig(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
int BBSnoop(int link,int node,int seconds);
#endif

View File

@@ -1,161 +0,0 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* initialize the Xycom SRM010 bus controller card
*/
/* base/src/drv $Id$ */
/* Author: Jeff Hill
* Date: 06-30-29
* Initialize xy010 bus controller
*/
static char *sccsID = "@(#)drvXy010.c 1.3\t6/3/93";
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <sysLib.h>
#include <vxLib.h>
#include <vme.h>
#include <drvSup.h>
#include <module_types.h>
/*
* These will hopefully go away
* as the drivers become more autonomous
*/
static long xy010_id_check(char *);
static long xy010_io_report(int);
static long xy010_init(void);
static long xy010_map(void);
struct {
long number;
DRVSUPFUN report;
DRVSUPFUN init;
} drvXy010={
2,
xy010_io_report,
xy010_init};
#define CSR_ADDR 0x81
#define XY010_ID "VMEIDXYC010"
#define XY_LED 0x3 /* set the Xycom status LEDs to OK */
LOCAL char *xy010_addr;
/*
* initialize the Xycom SRM010 bus controller card
*/
long
xy010_init()
{
char *pctlreg;
if(xy010_map()<0){
return ERROR;
}
if(xy010_id_check(xy010_addr)<0){
return OK;
}
/* Pointer to status control register. */
pctlreg = xy010_addr + CSR_ADDR;
*pctlreg = XY_LED;
return OK;
}
/*
*
* xy010_map()
*
*
*/
LOCAL
long xy010_map()
{
int status;
status = sysBusToLocalAdrs(
VME_AM_SUP_SHORT_IO,
xy010ScA16Base,
&xy010_addr);
if (status < 0){
printf("%s: xy010 A16 base addr map failed\n", __FILE__);
return ERROR;
}
return OK;
}
/*
*
* xy010_id_check()
*
*
*/
LOCAL
long xy010_id_check(pBase)
char *pBase;
{
char *pID;
char *pCmp;
char ID;
int status;
pID = pBase;
pCmp = XY010_ID;
while(*pCmp){
pID++; /* ID chars stored at odd addr */
status = vxMemProbe(pID, READ, sizeof(ID), &ID);
if(status < 0){
return ERROR;
}
if(*pCmp != ID){
return ERROR;
}
pID++;
pCmp++;
}
return OK;
}
/*
*
* xy010_io_report()
*
*
*/
long xy010_io_report(int level)
{
if(xy010_map()<0){
return ERROR;
}
if (xy010_id_check(xy010_addr) == OK) {
printf("SC: XY010:\tcard 0\n");
}
return OK;
}