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