1 /* 2 * Copyright (c) 1986 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are permitted 6 * provided that the above copyright notice and this paragraph are 7 * duplicated in all such forms and that any documentation, 8 * advertising materials, and other materials related to such 9 * distribution and use acknowledge that the software was developed 10 * by the University of California, Berkeley. The name of the 11 * University may not be used to endorse or promote products derived 12 * from this software without specific prior written permission. 13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 * 17 * @(#)psproto.h 7.2 (Berkeley) 09/16/88 18 */ 19 20 /* 21 * PS300-Host Handshake Protocol Definitions. 22 */ 23 24 /* 25 * Commands sent from host->PS300. 26 * 27 * In the initial handshake carried out when requesting 28 * one of these commands be performed, the PS300 always 29 * returns the identical code to indicate success. 30 */ 31 #define PS_ABORT 0x1000 /* abort current command */ 32 #define PS_RESET 0x3000 /* reset device */ 33 #define PS_RDNET 0x5000 /* logical read */ 34 #define PS_LOOKUP 0x8000 /* name lookup */ 35 #define PS_RDPHY 0x9000 /* physical read */ 36 #define PS_WRPHY_SYNC 0xa000 /* physical write w/ sync */ 37 #define PS_WRPHY 0xb000 /* physical write */ 38 #define PS_WRNET 0xc000 /* logical write */ 39 #define PS_DETACH 0xd000 /* normal/diagnostic detach */ 40 #define PS_ATTACH 0xe000 /* normal attach */ 41 #define PS_DATTACH 0xf000 /* diagnostic attach */ 42 43 #define PS_DIOREAD 0x4000 /* internal, wait for dioread attention */ 44 45 /* 46 * Command responses from PS300->host. 47 */ 48 #define PS_DMAOK(code) ((code)|0x0a00) /* successful dma transfer */ 49 #define PS_ADROK(code) ((code)|0x0100) /* successful address tranfer */ 50 51 #define PS_CODE(v) ((v)&0xf000) /* extract code from PS300 msg */ 52 #define PS_LUNIT(v) ((v)&0x000f) /* extract PS300 unit from msg */ 53 54 /* 55 * Single unit PS300 address list. 56 */ 57 struct psalist { 58 u_short nblocks; /* # of i/o vectors (we always use 1) */ 59 u_short addr[2]; /* PS300 address */ 60 u_short wc; /* transfer size */ 61 }; 62 63 /* 64 * The max dma size is actually 64KB, but 65 * we limit it to be just large enough for 66 * the maximum vector list as this is sufficient 67 * for our needs and we must allocate real 68 * memory to the intermediate buffer. 69 */ 70 #define PS_MAXDMA (1024+2048*12) 71 72 /* 73 * Pseudo commands used internally by the driver. 74 */ 75 #define PS_DMAOUT 0x0100 /* dma buffer host->PS300 */ 76 #define PS_DMAIN 0x0200 /* dma buffer PS300->host */ 77 78 /* 79 * Default timeouts. 80 */ 81 #define PS_TIMEOUT 30 /* dma/attention timeout (in hz) */ 82 #define PS_DIOTIMO 1000 /* dio polling timeout */ 83