134406Skarels /* 2*35514Sbostic * Copyright (c) 1986 The Regents of the University of California. 3*35514Sbostic * All rights reserved. 4*35514Sbostic * 5*35514Sbostic * Redistribution and use in source and binary forms are permitted 6*35514Sbostic * provided that the above copyright notice and this paragraph are 7*35514Sbostic * duplicated in all such forms and that any documentation, 8*35514Sbostic * advertising materials, and other materials related to such 9*35514Sbostic * distribution and use acknowledge that the software was developed 10*35514Sbostic * by the University of California, Berkeley. The name of the 11*35514Sbostic * University may not be used to endorse or promote products derived 12*35514Sbostic * from this software without specific prior written permission. 13*35514Sbostic * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14*35514Sbostic * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15*35514Sbostic * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16*35514Sbostic * 17*35514Sbostic * @(#)psreg.h 7.2 (Berkeley) 09/16/88 1834406Skarels */ 1930224Ssam 2030224Ssam #ifndef _PSREG_ 2130224Ssam #define _PSREG_ 2230224Ssam /* 2330224Ssam * PS300 definitions. 2430224Ssam */ 2530224Ssam #ifndef KERNEL 2630224Ssam #include <sys/ioctl.h> 2730224Ssam #else 2830224Ssam #include "../h/ioctl.h" 2930224Ssam #endif 3030224Ssam 3130224Ssam struct pslookup { 3230224Ssam int pl_len; /* length of name string */ 3330224Ssam char *pl_name; /* address of name string */ 3430224Ssam u_long pl_addr; /* symbol's address */ 3530224Ssam }; 3630224Ssam 3730224Ssam /* 3830224Ssam * Maximum string which may be supplied for lookup. 3930224Ssam */ 4030224Ssam #define PS_MAXNAMELEN 256 /* must be <= PSMAXDMA */ 4130224Ssam 4230224Ssam /* 4330224Ssam * When doing physical i/o, one may specify the address 4430224Ssam * and whether or not refresh sync should is required with 4530224Ssam * a null iovec descriptor (iov_len = 0). 4630224Ssam */ 4730224Ssam #define PSIO_SYNC 1 /* do physical write w/ refresh sync */ 4830224Ssam 4930224Ssam /* 5030224Ssam * Ioctl requests. 5130224Ssam */ 5233094Sbostic #define PSIOGETERROR _IOR('p', 0, int) /* get last error */ 5333094Sbostic #define PSIOLOOKUP _IOWR('p', 1, struct pslookup) /* do name lookup */ 5433094Sbostic #define PSIORWLOGICAL _IOWR('p', 2, int) /* set i/o mode */ 5530224Ssam 5630224Ssam /* 5730224Ssam * Error codes returned by PSIOGETERROR are either 5830224Ssam * returned by the PS300 or, from the list below, 5930224Ssam * generated by the device driver. 6030224Ssam */ 6130224Ssam #define PSERROR_DIOTIMO 1 /* timeout during dioread/diowrite */ 6230224Ssam #define PSERROR_INVALBC 2 /* invalid byte count for read/write */ 6330224Ssam #define PSERROR_BADADDR 3 /* invalid address for read/write */ 6430224Ssam #define PSERROR_BADCMD 4 /* invalid command in ikstart */ 6530224Ssam #define PSERROR_NAMETIMO 5 /* timeout during nameaddr dioread */ 6630224Ssam #define PSERROR_CMDTIMO 6 /* operation timed out */ 6730224Ssam #endif 68