xref: /csrg-svn/sys/tahoe/vba/psproto.h (revision 35514)
134406Skarels /*
2*35514Sbostic  * Copyright (c) 1986 The Regents of the University of California.
3*35514Sbostic  * All rights reserved.
4*35514Sbostic  *
5*35514Sbostic  * Redistribution and use in source and binary forms are permitted
6*35514Sbostic  * provided that the above copyright notice and this paragraph are
7*35514Sbostic  * duplicated in all such forms and that any documentation,
8*35514Sbostic  * advertising materials, and other materials related to such
9*35514Sbostic  * distribution and use acknowledge that the software was developed
10*35514Sbostic  * by the University of California, Berkeley.  The name of the
11*35514Sbostic  * University may not be used to endorse or promote products derived
12*35514Sbostic  * from this software without specific prior written permission.
13*35514Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*35514Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*35514Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16*35514Sbostic  *
17*35514Sbostic  *	@(#)psproto.h	7.2 (Berkeley) 09/16/88
1834406Skarels  */
1930224Ssam 
2030224Ssam /*
2130224Ssam  * PS300-Host Handshake Protocol Definitions.
2230224Ssam  */
2330224Ssam 
2430224Ssam /*
2530224Ssam  * Commands sent from host->PS300.
2630224Ssam  *
2730224Ssam  * In the initial handshake carried out when requesting
2830224Ssam  * one of these commands be performed, the PS300 always
2930224Ssam  * returns the identical code to indicate success.
3030224Ssam  */
3130224Ssam #define PS_ABORT        0x1000  /* abort current command */
3230224Ssam #define PS_RESET        0x3000  /* reset device */
3330224Ssam #define PS_RDNET        0x5000  /* logical read */
3430224Ssam #define PS_LOOKUP       0x8000  /* name lookup */
3530224Ssam #define PS_RDPHY        0x9000  /* physical read */
3630224Ssam #define PS_WRPHY_SYNC   0xa000  /* physical write w/ sync */
3730224Ssam #define PS_WRPHY        0xb000  /* physical write */
3830224Ssam #define PS_WRNET        0xc000  /* logical write */
3930224Ssam #define PS_DETACH       0xd000  /* normal/diagnostic detach */
4030224Ssam #define PS_ATTACH       0xe000  /* normal attach */
4130224Ssam #define PS_DATTACH      0xf000  /* diagnostic attach */
4230224Ssam 
4330224Ssam #define PS_DIOREAD      0x4000  /* internal, wait for dioread attention */
4430224Ssam 
4530224Ssam /*
4630224Ssam  * Command responses from PS300->host.
4730224Ssam  */
4830224Ssam #define PS_DMAOK(code)  ((code)|0x0a00) /* successful dma transfer */
4930224Ssam #define PS_ADROK(code)  ((code)|0x0100) /* successful address tranfer */
5030224Ssam 
5130224Ssam #define PS_CODE(v)      ((v)&0xf000)    /* extract code from PS300 msg */
5230224Ssam #define PS_LUNIT(v)     ((v)&0x000f)    /* extract PS300 unit from msg */
5330224Ssam 
5430224Ssam /*
5530224Ssam  * Single unit PS300 address list.
5630224Ssam  */
5730224Ssam struct  psalist {
5830224Ssam         u_short nblocks;                /* # of i/o vectors (we always use 1) */
5930224Ssam         u_short addr[2];                /* PS300 address */
6030224Ssam         u_short wc;                     /* transfer size */
6130224Ssam };
6230224Ssam 
6330224Ssam /*
6430224Ssam  * The max dma size is actually 64KB, but
6530224Ssam  * we limit it to be just large enough for
6630224Ssam  * the maximum vector list as this is sufficient
6730224Ssam  * for our needs and we must allocate real
6830224Ssam  * memory to the intermediate buffer.
6930224Ssam  */
7030224Ssam #define PS_MAXDMA       (1024+2048*12)
7130224Ssam 
7230224Ssam /*
7330224Ssam  * Pseudo commands used internally by the driver.
7430224Ssam  */
7530224Ssam #define PS_DMAOUT       0x0100          /* dma buffer host->PS300 */
7630224Ssam #define PS_DMAIN        0x0200          /* dma buffer PS300->host */
7730224Ssam 
7830224Ssam /*
7930224Ssam  * Default timeouts.
8030224Ssam  */
8130224Ssam #define PS_TIMEOUT      30              /* dma/attention timeout (in hz) */
8230224Ssam #define PS_DIOTIMO      1000            /* dio polling timeout */
83