BSD 4_3_Reno development
[unix-history] / .ref-fdb8e4aac282b72d4670aa3a26d9bba07afc7e6f / usr / src / sys / tahoe / vba / psproto.h
CommitLineData
430f81c3 1/*
d2e049c0
KB
2 * Copyright (c) 1986 The Regents of the University of California.
3 * All rights reserved.
4 *
b702c21d 5 * %sccs.include.redist.c%
d2e049c0 6 *
b702c21d 7 * @(#)psproto.h 7.3 (Berkeley) %G%
430f81c3 8 */
a994cc4f
SL
9
10/*
11 * PS300-Host Handshake Protocol Definitions.
12 */
13
14/*
15 * Commands sent from host->PS300.
16 *
17 * In the initial handshake carried out when requesting
18 * one of these commands be performed, the PS300 always
19 * returns the identical code to indicate success.
20 */
21#define PS_ABORT 0x1000 /* abort current command */
22#define PS_RESET 0x3000 /* reset device */
23#define PS_RDNET 0x5000 /* logical read */
24#define PS_LOOKUP 0x8000 /* name lookup */
25#define PS_RDPHY 0x9000 /* physical read */
26#define PS_WRPHY_SYNC 0xa000 /* physical write w/ sync */
27#define PS_WRPHY 0xb000 /* physical write */
28#define PS_WRNET 0xc000 /* logical write */
29#define PS_DETACH 0xd000 /* normal/diagnostic detach */
30#define PS_ATTACH 0xe000 /* normal attach */
31#define PS_DATTACH 0xf000 /* diagnostic attach */
32
33#define PS_DIOREAD 0x4000 /* internal, wait for dioread attention */
34
35/*
36 * Command responses from PS300->host.
37 */
38#define PS_DMAOK(code) ((code)|0x0a00) /* successful dma transfer */
39#define PS_ADROK(code) ((code)|0x0100) /* successful address tranfer */
40
41#define PS_CODE(v) ((v)&0xf000) /* extract code from PS300 msg */
42#define PS_LUNIT(v) ((v)&0x000f) /* extract PS300 unit from msg */
43
44/*
45 * Single unit PS300 address list.
46 */
47struct psalist {
48 u_short nblocks; /* # of i/o vectors (we always use 1) */
49 u_short addr[2]; /* PS300 address */
50 u_short wc; /* transfer size */
51};
52
53/*
54 * The max dma size is actually 64KB, but
55 * we limit it to be just large enough for
56 * the maximum vector list as this is sufficient
57 * for our needs and we must allocate real
58 * memory to the intermediate buffer.
59 */
60#define PS_MAXDMA (1024+2048*12)
61
62/*
63 * Pseudo commands used internally by the driver.
64 */
65#define PS_DMAOUT 0x0100 /* dma buffer host->PS300 */
66#define PS_DMAIN 0x0200 /* dma buffer PS300->host */
67
68/*
69 * Default timeouts.
70 */
71#define PS_TIMEOUT 30 /* dma/attention timeout (in hz) */
72#define PS_DIOTIMO 1000 /* dio polling timeout */