1*30224Ssam /* psreg.h 1.1 86/11/29 */ 2*30224Ssam 3*30224Ssam #ifndef _PSREG_ 4*30224Ssam #define _PSREG_ 5*30224Ssam /* 6*30224Ssam * PS300 definitions. 7*30224Ssam */ 8*30224Ssam #ifndef KERNEL 9*30224Ssam #include <sys/ioctl.h> 10*30224Ssam #else 11*30224Ssam #include "../h/ioctl.h" 12*30224Ssam #endif 13*30224Ssam 14*30224Ssam struct pslookup { 15*30224Ssam int pl_len; /* length of name string */ 16*30224Ssam char *pl_name; /* address of name string */ 17*30224Ssam u_long pl_addr; /* symbol's address */ 18*30224Ssam }; 19*30224Ssam 20*30224Ssam /* 21*30224Ssam * Maximum string which may be supplied for lookup. 22*30224Ssam */ 23*30224Ssam #define PS_MAXNAMELEN 256 /* must be <= PSMAXDMA */ 24*30224Ssam 25*30224Ssam /* 26*30224Ssam * When doing physical i/o, one may specify the address 27*30224Ssam * and whether or not refresh sync should is required with 28*30224Ssam * a null iovec descriptor (iov_len = 0). 29*30224Ssam */ 30*30224Ssam #define PSIO_SYNC 1 /* do physical write w/ refresh sync */ 31*30224Ssam 32*30224Ssam /* 33*30224Ssam * Ioctl requests. 34*30224Ssam */ 35*30224Ssam #define PSIOGETERROR _IOR(p, 0, int) /* get last error */ 36*30224Ssam #define PSIOLOOKUP _IOWR(p, 1, struct pslookup) /* do name lookup */ 37*30224Ssam #define PSIORWLOGICAL _IOWR(p, 2, int) /* set i/o mode */ 38*30224Ssam 39*30224Ssam /* 40*30224Ssam * Error codes returned by PSIOGETERROR are either 41*30224Ssam * returned by the PS300 or, from the list below, 42*30224Ssam * generated by the device driver. 43*30224Ssam */ 44*30224Ssam #define PSERROR_DIOTIMO 1 /* timeout during dioread/diowrite */ 45*30224Ssam #define PSERROR_INVALBC 2 /* invalid byte count for read/write */ 46*30224Ssam #define PSERROR_BADADDR 3 /* invalid address for read/write */ 47*30224Ssam #define PSERROR_BADCMD 4 /* invalid command in ikstart */ 48*30224Ssam #define PSERROR_NAMETIMO 5 /* timeout during nameaddr dioread */ 49*30224Ssam #define PSERROR_CMDTIMO 6 /* operation timed out */ 50*30224Ssam #endif 51