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