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