134406Skarels /* 235514Sbostic * Copyright (c) 1986 The Regents of the University of California. 335514Sbostic * All rights reserved. 435514Sbostic * 5*44534Sbostic * %sccs.include.redist.c% 635514Sbostic * 7*44534Sbostic * @(#)psproto.h 7.3 (Berkeley) 06/28/90 834406Skarels */ 930224Ssam 1030224Ssam /* 1130224Ssam * PS300-Host Handshake Protocol Definitions. 1230224Ssam */ 1330224Ssam 1430224Ssam /* 1530224Ssam * Commands sent from host->PS300. 1630224Ssam * 1730224Ssam * In the initial handshake carried out when requesting 1830224Ssam * one of these commands be performed, the PS300 always 1930224Ssam * returns the identical code to indicate success. 2030224Ssam */ 2130224Ssam #define PS_ABORT 0x1000 /* abort current command */ 2230224Ssam #define PS_RESET 0x3000 /* reset device */ 2330224Ssam #define PS_RDNET 0x5000 /* logical read */ 2430224Ssam #define PS_LOOKUP 0x8000 /* name lookup */ 2530224Ssam #define PS_RDPHY 0x9000 /* physical read */ 2630224Ssam #define PS_WRPHY_SYNC 0xa000 /* physical write w/ sync */ 2730224Ssam #define PS_WRPHY 0xb000 /* physical write */ 2830224Ssam #define PS_WRNET 0xc000 /* logical write */ 2930224Ssam #define PS_DETACH 0xd000 /* normal/diagnostic detach */ 3030224Ssam #define PS_ATTACH 0xe000 /* normal attach */ 3130224Ssam #define PS_DATTACH 0xf000 /* diagnostic attach */ 3230224Ssam 3330224Ssam #define PS_DIOREAD 0x4000 /* internal, wait for dioread attention */ 3430224Ssam 3530224Ssam /* 3630224Ssam * Command responses from PS300->host. 3730224Ssam */ 3830224Ssam #define PS_DMAOK(code) ((code)|0x0a00) /* successful dma transfer */ 3930224Ssam #define PS_ADROK(code) ((code)|0x0100) /* successful address tranfer */ 4030224Ssam 4130224Ssam #define PS_CODE(v) ((v)&0xf000) /* extract code from PS300 msg */ 4230224Ssam #define PS_LUNIT(v) ((v)&0x000f) /* extract PS300 unit from msg */ 4330224Ssam 4430224Ssam /* 4530224Ssam * Single unit PS300 address list. 4630224Ssam */ 4730224Ssam struct psalist { 4830224Ssam u_short nblocks; /* # of i/o vectors (we always use 1) */ 4930224Ssam u_short addr[2]; /* PS300 address */ 5030224Ssam u_short wc; /* transfer size */ 5130224Ssam }; 5230224Ssam 5330224Ssam /* 5430224Ssam * The max dma size is actually 64KB, but 5530224Ssam * we limit it to be just large enough for 5630224Ssam * the maximum vector list as this is sufficient 5730224Ssam * for our needs and we must allocate real 5830224Ssam * memory to the intermediate buffer. 5930224Ssam */ 6030224Ssam #define PS_MAXDMA (1024+2048*12) 6130224Ssam 6230224Ssam /* 6330224Ssam * Pseudo commands used internally by the driver. 6430224Ssam */ 6530224Ssam #define PS_DMAOUT 0x0100 /* dma buffer host->PS300 */ 6630224Ssam #define PS_DMAIN 0x0200 /* dma buffer PS300->host */ 6730224Ssam 6830224Ssam /* 6930224Ssam * Default timeouts. 7030224Ssam */ 7130224Ssam #define PS_TIMEOUT 30 /* dma/attention timeout (in hz) */ 7230224Ssam #define PS_DIOTIMO 1000 /* dio polling timeout */ 73