Add Fred Cawthorne's GPIB driver.

Submitted by:	fcawth@delphi.umd.edu
This commit is contained in:
Jordan K. Hubbard 1994-12-17 08:07:03 +00:00
parent df26e9b0b2
commit cdf25f3740
9 changed files with 1405 additions and 7 deletions

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.117 1994/12/16 06:04:16 phk Exp $
# $Id: LINT,v 1.118 1994/12/16 16:58:08 bde Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -436,11 +436,13 @@ options FDSEEKWAIT="16"
# mse: Logitech and ATI InPort bus mouse ports
# psm: PS/2 mouse port (needs ALLOW_CONFLICT_IOADDR, above)
# sio: serial ports (see sio(4))
# gp: National Instruments AT-GPIB and AT-GPIB/TNT board
device lpt0 at isa? port "IO_LPT3" tty irq 7 vector lptintr
device mse0 at isa? port 0x23c tty irq 5 vector mseintr
device psm0 at isa? port "IO_KBD" tty irq 12 vector psmintr
device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
device gp0 at isa? port 0x2c0 tty
# Options for sio:
options COMCONSOLE #prefer serial console to video console

View File

@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
# $Id: files.i386,v 1.64 1994/12/03 00:17:55 wollman Exp $
# $Id: files.i386,v 1.65 1994/12/11 23:39:01 bde Exp $
#
i386/apm/apm.c optional apm device-driver
i386/apm/apm_setup.s optional apm
@ -59,6 +59,7 @@ i386/isa/fd.c optional fd device-driver
i386/isa/ft.c optional ft device-driver
i386/isa/elink.c optional ie device-driver
i386/isa/elink.c optional ep device-driver
i386/isa/gpib.c optional gp device-driver
i386/isa/if_cx.c optional cx device-driver
i386/isa/if_ed.c optional ed device-driver
i386/isa/if_el.c optional el device-driver

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.117 1994/12/16 06:04:16 phk Exp $
# $Id: LINT,v 1.118 1994/12/16 16:58:08 bde Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -436,11 +436,13 @@ options FDSEEKWAIT="16"
# mse: Logitech and ATI InPort bus mouse ports
# psm: PS/2 mouse port (needs ALLOW_CONFLICT_IOADDR, above)
# sio: serial ports (see sio(4))
# gp: National Instruments AT-GPIB and AT-GPIB/TNT board
device lpt0 at isa? port "IO_LPT3" tty irq 7 vector lptintr
device mse0 at isa? port 0x23c tty irq 5 vector mseintr
device psm0 at isa? port "IO_KBD" tty irq 12 vector psmintr
device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
device gp0 at isa? port 0x2c0 tty
# Options for sio:
options COMCONSOLE #prefer serial console to video console

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.117 1994/12/16 06:04:16 phk Exp $
# $Id: LINT,v 1.118 1994/12/16 16:58:08 bde Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -436,11 +436,13 @@ options FDSEEKWAIT="16"
# mse: Logitech and ATI InPort bus mouse ports
# psm: PS/2 mouse port (needs ALLOW_CONFLICT_IOADDR, above)
# sio: serial ports (see sio(4))
# gp: National Instruments AT-GPIB and AT-GPIB/TNT board
device lpt0 at isa? port "IO_LPT3" tty irq 7 vector lptintr
device mse0 at isa? port 0x23c tty irq 5 vector mseintr
device psm0 at isa? port "IO_KBD" tty irq 12 vector psmintr
device sio0 at isa? port "IO_COM1" tty irq 4 vector siointr
device gp0 at isa? port 0x2c0 tty
# Options for sio:
options COMCONSOLE #prefer serial console to video console

View File

@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
# $Id: files.i386,v 1.64 1994/12/03 00:17:55 wollman Exp $
# $Id: files.i386,v 1.65 1994/12/11 23:39:01 bde Exp $
#
i386/apm/apm.c optional apm device-driver
i386/apm/apm_setup.s optional apm
@ -59,6 +59,7 @@ i386/isa/fd.c optional fd device-driver
i386/isa/ft.c optional ft device-driver
i386/isa/elink.c optional ie device-driver
i386/isa/elink.c optional ep device-driver
i386/isa/gpib.c optional gp device-driver
i386/isa/if_cx.c optional cx device-driver
i386/isa/if_ed.c optional ed device-driver
i386/isa/if_el.c optional el device-driver

View File

@ -41,7 +41,7 @@
* SUCH DAMAGE.
*
* from: @(#)conf.c 5.8 (Berkeley) 5/12/91
* $Id: conf.c,v 1.44 1994/12/04 20:08:57 phk Exp $
* $Id: conf.c,v 1.45 1994/12/11 23:05:18 bde Exp $
*/
#include <sys/param.h>
@ -644,6 +644,19 @@ extern struct tty *cx_tty[];
#define cx_tty NULL
#endif
#include "gp.h"
#if NGP > 0
d_open_t gpopen;
d_close_t gpclose;
d_rdwr_t gpwrite;
d_ioctl_t gpioctl;
#else
#define gpopen (d_open_t *)enxio
#define gpclose (d_close_t *)enxio
#define gpwrite (d_rdwr_t *)enxio
#define gpioctl (d_ioctl_t *)enxio
#endif
/* open, close, read, write, ioctl, stop, reset, ttys, select, mmap, strat */
struct cdevsw cdevsw[] =
{
@ -787,7 +800,10 @@ struct cdevsw cdevsw[] =
cxselect, nommap, NULL },
{ vnopen, vnclose, rawread, rawwrite, /*43*/
vnioctl, nostop, nullreset, NULL, /* vn */
seltrue, nommap, vnstrategy }
seltrue, nommap, vnstrategy },
{ gpopen, gpclose, noread, gpwrite, /*44*/
gpioctl, nostop, nullreset, NULL, /* GPIB */
seltrue, nommap, NULL },
};
int nchrdev = sizeof (cdevsw) / sizeof (cdevsw[0]);

1269
sys/i386/isa/gpib.c Normal file

File diff suppressed because it is too large Load Diff

19
sys/i386/isa/gpib.h Normal file
View File

@ -0,0 +1,19 @@
/* gpib data structures */
struct gpibdata {
char *data; /* data string for ins and outs */
unsigned char address; /* gpib address */
int *count;
} ;
/* IOCTL commands */
#define GPIBWRITE _IOW('g',1,struct gpibdata)
#define GPIBREAD _IOW('g',2,struct gpibdata)
#define GPIBINIT _IOW('g',3,struct gpibdata)
#define GPIBTRIGGER _IOW('g',4,struct gpibdata)
#define GPIBREMOTE _IOW('g',5,struct gpibdata)
#define GPIBLOCAL _IOW('g',6,struct gpibdata)
#define GPIBMTRIGGER _IOW('g',7,struct gpibdata)
#define GPIBMREMOTE _IOW('g',8,struct gpibdata)
#define GPIBMLOCAL _IOW('g',9,struct gpibdata)
#define GPIBSPOLL _IOW('g',10,struct gpibdata)

86
sys/i386/isa/gpibreg.h Normal file
View File

@ -0,0 +1,86 @@
static short gpib_port=0x2c0;
#define IEEE gpib_port
/*NAT4882 Registers*/
#define DIR IEEE+0
#define CDOR IEEE+0
#define ISR1 IEEE+2
#define IMR1 IEEE+2
#define ISR2 IEEE+4
#define IMR2 IEEE+4
#define SPSR IEEE+6
#define KSR IEEE+0x17
#define KCR IEEE+0x17
#define SPMR IEEE+6
#define ADSR IEEE+8
#define ADMR IEEE+8
#define CPTR IEEE+0x0A
#define SASR IEEE+0x1B
#define AUXMR IEEE+0x0A
#define ADR0 IEEE+0x0c
#define ISR0 IEEE+0x1d
#define IMR0 IEEE+0x1d
#define ADR IEEE+0x0c
#define ADR1 IEEE+0x0e
#define BSR IEEE+0x1f
#define BCR IEEE+0x1f
#define EOSR IEEE+0x0e
/*Turbo 488 Registers*/
#define CNT2 IEEE+0x09
#define CNT3 IEEE+0x0b
#define HSSEL IEEE+0x0d
#define STS1 IEEE+0x10
#define CFG IEEE+0x10
#define IMR3 IEEE+0x12
#define CNT0 IEEE+0x14
#define CNT1 IEEE+0x16
#define FIFOB IEEE+0x18
#define FIFOA IEEE+0x19
#define ISR3 IEEE+0x1a
#define CCRG IEEE+0x1a
#define STS2 IEEE+0x1c
#define CMDR IEEE+0x1c
#define TIMER IEEE+0x1e
#define ACCWR IEEE+0x05
#define INTR IEEE+0x07
#define pon 0
#define chip_reset 2
#define rhdf 3
#define trig 4
#define rtl_pulse 5
#define rtl_off 5
#define rtl_on 0x0d
#define seoi 6
#define ist_off 1
#define ist_on 9
#define rlc 0x0a
#define rqc 8
#define lut 0x0b
#define lul 0x0c
#define nbaf 0x0e
#define gts 0x10
#define tca 0x11
#define tcs 0x12
#define tcse 0x1a
#define ltn 0x13
#define ltn_cont 0x1b
#define lun 0x1c
#define rsc_off 0x14
#define sic_rsc 0x1e
#define sic_rsc_off 0x16
#define sre_rsc 0x1f
#define sre_rsc_off 0x17
#define reqt 0x18
#define reqf 0x19
#define rppl 0x1d
#define hldi 0x51